I need a 4 column (subject predicate object predicate-weight) graph database to which I can import .ttl files.

I was using Virtuoso until now but it does not support labelled/weighted edges.

Another choice is Neo4j but it does not support RDF triples out of the box (the triples need to be converted to CSV format before being uploaded).

It’s a simple requirement, but I couldn’t find anything except R2DF, but that AFAIK is not available or is still just a concept.


  • Platform: Linux CentOS
  • Gratis, at least for education use
  • RDF triple (.ttl) support
  • Graph-based
  • Handling large datasets (approximately 5 million rows or so)


A sample row from the .ttl:

<http://dbpedia.org/resource/Category:Futurama> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> 8.0 .
  • 1
    How are labels/weights described in your RDF? Reification? Please post a sample of the .ttl thanks!
    – Nicolas Raoul
    Mar 17 '16 at 8:44
  • I will be adding the weights in later stages.
    – Vulcan
    Mar 17 '16 at 8:49
  • Have you tried Allegro? franz.com/agraph/allegrograph Mar 17 '16 at 13:19
  • @retrography i could not find any concept of weighted/labelled edges in Allegro. I think you meant the how range queries are processed in it? I think that could do.
    – Vulcan
    Mar 17 '16 at 14:04

Your Turtle example is actually not syntactically valid, because Turtle is a "triples-only" format - so you won't find any tool that can parse/process that. The notion of weighted edges takes you outside the realm of the RDF standards, which is why you won't find many RDF tools offering explicit support for it.

However, you might be able to achieve what you want with most standard RDF tools if you're willing to slightly modify your data. I'll use RDF4J in this example.

To model edge weights, you can use the notion of "named graphs" - which in RDF4J is supported via the use of quads instead of triples. Using, for example, N-Quads as the format (very similar to Turtle/N-Triples, but allows for the extra named graph info needed), your example could look like this:

<http://dbpedia.org/resource/Category:Futurama> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2004/02/skos/core#Concept> <http://example.org/weight-8-0> .
<http://example.org/weight-8-0> rdfs:label 8.0 .

As you can see the idea is to define a new named graph (identified by http://example.org/weight-8-0 in this example), and use that as the graph identifier for the statement you want to assign a weight to. The second statement is merely there to link an actual weight value to the identifier.

Of course, this approach does mean that you introduce a new RDF statement for every single possible weight value, so it's only really workable if there is some manageable number of possible values. Then again you are talking about 5 million statements in your dataset, so in the worst possible case you would double that, to 10 million statements, which is still easily manageable by most RDF databases.

Using this approach, Eclipse RDF4J (formerly known as OpenRDF Sesame) is a good framework to use. It's open source (Eclipse Distribution License), platform-independent (Java), has support for Turtle as well as N-Quads and TriG syntaxes (and most other RDF syntax formats), and full SPARQL 1.1 support as well as a comprehensive Java API. Its own databases can handle up to the order of 100M statements, and if you want to scale beyond that, there are plenty of scalable RDF database vendors that are fully RDF4J-compatible (so you can switch database implementation without having to change your code).

  • Thanks for replying. I've put this project on hold for now( because of many issues and difficulties). Will get back to test your answer when i resume work on my project. Pretty Soon.
    – Vulcan
    Oct 8 '16 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.