In years, there was a proliferation of articles, LinkedIn posts, and advertising supplies presenting graph information fashions from completely different views. This text will chorus from discussing particular merchandise and as an alternative focus solely on the comparability of RDF (Useful resource Description Framework) and LPG (Labelled Property Graph) information fashions. To make clear, there is no such thing as a mutually unique alternative between RDF and LPG — they are often employed in conjunction. The suitable alternative will depend on the precise use case, and in some cases each fashions could also be crucial; there is no such thing as a single information mannequin that’s universally relevant. In actual fact, polyglot persistence and multi—mannequin databases (databases that may help completely different information fashions inside the database engine or on prime of the engine), are gaining reputation as enterprises recognise the significance of storing information in numerous codecs to maximise its worth and forestall stagnation. For example, storing time collection monetary information in a graph mannequin just isn’t essentially the most environment friendly strategy, because it may lead to minimal worth extraction in comparison with storing it in a time collection matrix database, which allows speedy and multi—dimensional analytical queries.
The aim of this dialogue is to offer a complete comparability of RDF and Lpg information fashions, highlighting their distinct functions and overlapping utilization. Whereas articles typically current biased evaluations, selling their very own instruments, it’s important to acknowledge that these comparisons are sometimes flawed, as they examine apples to wheelbarrows moderately than apples to apples. This subjectivity can go away readers perplexed and unsure concerning the writer’s supposed message. In distinction, this text goals to offer an goal evaluation, specializing in the strengths and weaknesses of each RDF and LPG information fashions, moderately than performing as promotional materials for any device.
Fast recap of the info fashions
Each Rdf and LPG are descendants of the graph information mannequin, though they possess completely different buildings and traits. A graph contains vertices (nodes) and edges that join two vertices. Varied graph varieties exist, together with undirected graphs, directed graphs, multigraphs, hypergraphs and so forth. The RDF and LPG information fashions undertake the directed multigraph strategy, whereby edges have the “from” and “to” ordering, and may be a part of an arbitrary variety of distinct edges.
The RDF information mannequin is represented by a set of triples reflecting the pure language construction of topic—verb—object, with the topic, predicate, and object represented as such. Think about the next easy instance: Jeremy was born in Birkirkara. This sentence might be represented as an RDF assertion or reality with the next construction — Jeremy is a topic useful resource, the predicate (relation) is born in, and the item worth of Birkirkara. The worth node may both be a URI (distinctive useful resource identifier) or a datatype worth (reminiscent of integer or string). If the item is a semantic URI, or as they’re additionally recognized a useful resource, then the item would result in different details, reminiscent of Birkirkara townIn Malta. This information mannequin permits for assets to be reused and interlinked in the identical RDF—based mostly graph, or in some other RDF graph, inside or exterior. As soon as a useful resource is outlined and a URI is “minted”, this URI turns into immediately accessible and can be utilized in any context that’s deemed crucial.
However, the LPG information mannequin encapsulates the set of vertices, edges, label project capabilities for vertices and edges, and key—worth property project perform for vertices and edges. For the earlier instance, the illustration can be as follows:
(particular person:Individual {title: "Jeremy"})
(metropolis:Metropolis {title: "Birkirkara"})
(particular person)—[:BORN_IN]—>(metropolis)
Consequently, the first distinction between RDF and LPG lies inside how nodes are linked collectively. Within the RDF mannequin, relationships are triples the place predicates outline the connection. Within the LPG information mannequin, edges are first—class residents with their very own properties. Subsequently, within the RDF information mannequin, predicates are globally outlined in a schema and are reused in information graphs, while within the LPG information mannequin, every edge is uniquely recognized.
Schema vs Schema—much less. Do semantics matter in any respect?
Semantics is a department of linguistics and logic that’s involved concerning the that means, on this case the that means of knowledge, enabling each people and machines to interpret the context of the info and any relationships within the mentioned context.
Traditionally, the World Huge Net Consortium (W3C) established the Useful resource Description Framework (RDF) information mannequin as a standardised framework for information alternate inside the Net. RDF facilitates seamless information integration and the merging of numerous sources, whereas concurrently supporting schema evolution with out necessitating modifications to information shoppers. Schemas1, or ontologies, function the muse for information represented in RDF, and thru these ontologies the semantic that means of the info might be outlined. This functionality makes information integration one of many quite a few appropriate functions of the RDF information mannequin. By means of varied W3C teams, requirements had been established on how schemas and ontologies might be outlined, primarily RDF Schema (RDFS), Net Ontology Language (OWL), and not too long ago SHACL. RDFS supplies the low—degree constructs for outlining ontologies, such because the Individual entity with properties title, gender, is aware of, and the anticipated kind of node. OWL supplies constructs and mechanisms for formally defining ontologies via axioms and guidelines, enabling the inference of implicit information. While OWL axioms are taken as a part of the data graph and used to deduce further details, SHACL was launched as a schema to validate constraints, higher often known as information shapes (think about it as “what ought to a Individual encompass?”) towards the data graph. Furthermore, via further options to the SHACL specs, guidelines and inference axioms will also be outlined utilizing SHACL.
In abstract, schemas facilitate the enforcement of the appropriate occasion information. That is attainable as a result of the RDF permits any worth to be outlined inside a reality, supplied it adheres to the specs. Validators, reminiscent of in—constructed SHACL engines or OWL constructs, are liable for verifying the info’s integrity. On condition that these validators are standardised, all triple shops, these adhering to the RDF information mannequin, are inspired to implement them. Nevertheless, this doesn’t negate the idea of flexibility. The RDF information mannequin is designed to accommodate the progress, extension, and evolution of knowledge inside the schema’s boundaries. Consequently, whereas an RDF information mannequin strongly encourages using schemas (or ontologies) as its basis, consultants discourage the creation of ivory tower ontologies. This endeavour does require an upfront effort and collaboration with area consultants to assemble an ontology that precisely displays the use case and the info that will probably be saved within the data graph. Nonetheless, the RDF information mannequin provides the pliability to create and outline RDF—based mostly information independently of a pre—current ontology, or to develop an ontology iteratively all through an information mission. Moreover, schemas are designed for reuse, and the RDF information mannequin facilitates this reusability. It’s noteworthy that an RDF—based mostly data graph sometimes encompasses each occasion information (reminiscent of “Giulia and Matteo are siblings”) and ontology/schema axioms (reminiscent of “Two individuals are siblings after they have a mother or father in widespread”).
Nonetheless, the importance of ontologies extends past offering an information construction; additionally they impart semantic that means to the info. For example, in setting up a household tree, an ontology allows the specific definition of relationships reminiscent of aunt, uncle, cousins, niece, nephew, ancestors, and descendants with out the necessity for the specific information to be outlined within the data graph. Think about how this idea might be utilized in varied pharmaceutical situations, simply to say one vertical area. Reasoning is a elementary part that renders the RDF information mannequin a semantically highly effective mannequin for designing data graphs. Ontologies present a selected information level with all the mandatory context, together with its neighbourhood and its that means. For example, if there’s a literal node with the worth 37, an RDF—based mostly agent can comprehend that the worth 37 represents the age of an individual named Jeremy, who’s the nephew of an individual named Peter.
In distinction, the LPG information mannequin provides a extra agile and simple deployment of graph information. LPGs have decreased concentrate on schemas (they solely help some constraints and “labels”/lessons). Graph databases adhering to the LPG information mannequin are recognized for his or her pace in making ready information for consumption resulting from its schema—much less nature. This makes them a extra appropriate alternative for information architects searching for to deploy their information in such a fashion. The LPG information mannequin is especially advantageous in situations the place information just isn’t supposed for progress or important modifications. For example, a modification to a property would necessitate refactoring the graph to replace nodes with the newly added or up to date key—worth property. Whereas LPG supplies the phantasm of offering semantics via node and edge labels and corresponding capabilities, it doesn’t inherently achieve this. LPG capabilities persistently return a map of values related to a node or edge. Nonetheless, that is elementary when coping with use instances that must carry out quick graph algorithms as the info is obtainable immediately within the nodes and edges, and there’s no want for additional graph traversal.
Nevertheless, one elementary characteristic of the LPG information mannequin is its ease and adaptability of attaching granular attributes or properties to both vertices or edges. For example, if there are two particular person nodes, “Alice” and “Bob,” with an edge labelled “marriedTo,” the LPG information mannequin can precisely and simply state that Alice and Bob had been married on February 29, 2024. In distinction, the RDF information mannequin may obtain this via varied workarounds, reminiscent of reification, however this could lead to extra advanced queries in comparison with the LPG information mannequin’s counterpart.
Requirements, Standardisation Our bodies, Interoperability.
Within the earlier part we described how W3C supplies standardisation teams pertaining to the RDF information mannequin. For example, a W3C working group is actively growing the RDF* customary, which includes the advanced relationship idea (attaching attributes to details/triples) inside the RDF information mannequin. This customary is anticipated to be adopted and supported by all triple shops instruments and brokers based mostly on the RDF information mannequin. Nevertheless, the method of standardisation might be protracted, continuously leading to delays that go away such distributors at an obstacle.
Nonetheless, requirements facilitate a lot—wanted interoperability. Information Graphs constructed upon the RDF information mannequin might be simply ported between completely different functions and triple retailer, as they haven’t any vendor lock—in, and standardisation codecs are supplied. Equally, they are often queried with one customary question language referred to as SPARQL, which is utilized by the completely different distributors. While the question language is similar, distributors go for completely different question execution plans, equal to how any database engine (SQL or NoSQL) is carried out, to boost efficiency and pace.
Most LPG graph implementations, though open supply, utilise proprietary or customized languages for storing and querying information, missing a typical adherence. This apply decreases interoperability and portability of knowledge between completely different distributors. Nevertheless, in latest months, ISO accredited and revealed ISO/IEC 39075:2024 that standardises the Graph Question Language (GQL) based mostly on Cypher. Because the constitution rightly factors out, the graph information mannequin has distinctive benefits over relational databases reminiscent of becoming information that’s meant to have hierarchical, advanced or arbitrary buildings. Nonetheless, the proliferation of vendor—particular implementations overlooks an important performance – a standardised strategy to querying property graphs. Subsequently, it’s paramount that property graph distributors mirror their merchandise to this customary.
Just lately, OneGraph2 was proposed as an interoperable metamodel that’s meant to beat the selection between the RDF information mannequin and the LPG information mannequin. Moreover, extensions to openCypher are proposed3 to permit the querying over RDF information to be prolonged as a means of querying over RDF information. This imaginative and prescient goals to pave the way in which for having information in each RDF and LPG mixed in a single, built-in database, guaranteeing the advantages of each information fashions.
Different notable variations
Notable variations, largely in question languages, are there to help the info fashions. Nevertheless, we strongly argue towards the truth that a set of question language options ought to dictate which information mannequin to make use of. Nonetheless, we are going to talk about among the variations right here for a extra full overview.
The RDF information mannequin provides a pure means of supporting world distinctive useful resource identifiers (URIs), which manifest in three distinct traits. Inside the RDF area, a set of details described by an RDF assertion (i.e. s, p, o) having the identical topic URI is known as a useful resource. Information saved in RDF graphs might be conveniently break up into a number of named graphs, guaranteeing that every graph encapsulates distinct issues. For example, utilizing the RDF information mannequin it’s easy to assemble graphs that retailer information or assets, metadata, audit and provenance information individually, while interlinking and querying capabilities might be seamlessly executed throughout these a number of graphs. Moreover, graphs can set up interlinks with assets situated in graphs hosted on completely different servers. Querying these exterior assets is facilitated via question federation inside the SPARQL protocol. Given the adoption of URIs, RDF embodies the unique imaginative and prescient of Linked Information4, a imaginative and prescient that has since been adopted, to an extent, as a tenet within the FAIR ideas5, Information Cloth, Information Mesh, and HATEOAS amongst others. Consequently, the RDF information mannequin serves as a flexible framework that may seamlessly combine with these visions with out the necessity for any modifications.
LPGs, alternatively, are higher geared in the direction of path traversal queries, graph analytics and variable size path queries. While these functionalities might be thought-about as particular implementations within the question language, they’re pertinent concerns when modelling information in a graph, since these are additionally advantages over conventional relational databases. SPARQL, via the W3C suggestion, has restricted help to path traversal6, and a few vendor triple retailer implementations do help and implement (though not as a part of the SPARQL 1.1 suggestion) variable size path7. At time of writing, the SPARQL 1.2 suggestion is not going to incorporate this characteristic both.
Information Graph Patterns
The next part describes varied information graph patterns and the way they might match, or not, each information fashions mentioned on this article.
Sample | RDF information mannequin | LPG information mannequin |
World Definition of relations/properties | By means of schemas properties are globally outlined via varied semantic properties reminiscent of area and ranges, algebraic properties reminiscent of inverse of, reflexive, transitive, and permit for informative annotations on properties definitions. | Semantics of relations (edges) just isn’t supported in property graphs |
A number of Languages | String information can have a language tag hooked up to it and is taken into account when processing | Could be a customized area or relationship (e.g. label_en, label_mt) however haven’t any particular therapy. |
Taxonomy – Hierarchy | Automated inferencing, reasoning and may deal with advanced lessons. | Can mannequin hierarchies, however not mannequin hierarchies of lessons of people. Would require express traversal of classification hierarchies |
Particular person Relationships | Requires workarounds like reification and sophisticated queries. | Could make direct assertions over them, pure illustration and environment friendly querying. |
Property Inheritance | Properties inherited via outlined class hierarchies. Moreover, the RDF information mannequin has the flexibility to signify subproperties. | Should be dealt with in utility logic. |
N—ary Relations | Typically binary relationships are represented in triples, however N—ary relations might be performed by way of clean nodes, further assets, or reification. | Can typically be translated to further attributes on edges. |
Property Constraints and Validation | Obtainable via schema definitions: RDFS, OWL or SHACL. | Helps minimal constraints reminiscent of worth uniqueness however usually requires validation via schema layers or utility logic. |
Context and Provenance | May be performed in varied methods, together with having a separate named graph and hyperlinks to the primary assets, or via reification. | Can add properties to nodes and edges to seize context and provenance. |
Inferencing | Automate the inferencing of inverse relationships, transitive patterns, advanced property chains, disjointness and negation. | Both require express definition, in utility logic, or no help in any respect (disjointness and negation). |
Semantics in Graphs — A Household Tree Instance
A complete exploration of the applying of RDF information mannequin and semantics inside an LPG utility might be present in varied articles revealed on Medium, LinkedIn, and different blogs. As outlined within the earlier part, the LPG information mannequin just isn’t particularly designed for reasoning functions. Reasoning includes making use of logical guidelines on current details as a approach to deduce new data; that is necessary because it helps uncover hidden relationships that weren’t explicitly said earlier than.
On this part we are going to exhibit how axioms are outlined for a easy but sensible instance of a household tree. A household tree is a perfect candidate for any graph database resulting from its hierarchical construction and its flexibility in being outlined inside any information mannequin. For this demonstration, we are going to mannequin the Pewterschmidt household, which is a fictional household from the favored animated tv collection Family Guy.
On this case, we’re simply creating one relationship referred to as ‘hasChild’. So, Carter has a toddler named Lois, and so forth. The one different attribute we’re including is the gender (Male/Feminine). For the RDF information mannequin, we have now created a easy OWL ontology:

The present schema allows us to signify the household tree in an RDF information mannequin. With ontologies, we are able to begin defining the next properties, whose information might be deduced from the preliminary information. We introduce the next properties:
Property | Remark | Axiom | Instance |
isAncestorOf | A transitive property which can also be the inverse of the isDescendentOf property. OWL engines mechanically infer transitive properties with out the necessity of guidelines. | hasChild(?x, ?y) —> isAncestorOf(?x, ?y) | Carter – isAncestorOf —> Lois – isAncestorOf —> Chris Carter – isAncestorOf —> Chris |
isDescendentOf | A transitive property, inverse of isAncestorOf. OWL engines mechanically infers inverse properties with out the necessity of guidelines | — | Chris – isDescendentOf —> Peter |
isBrotherOf | A subproperty of isSiblingOf and disjoint with isSisterOf, that means that the identical particular person can’t be the brother and the sister of one other particular person on the similar time, while they can’t be the brother of themselves. | hasChild(?x, ?y), hasChild(?x, ?z), hasGender(?y, Male), notEqual(?y, ?z) —> isBrotherOf(?y, ?z) | Chris – isBrotherOf —> Meg |
isSisterOf | A subproperty of isSiblingOf and disjoint with isBrotherOf, that means that the identical particular person can’t be the brother and the sister or one other particular person on the similar time, while they can’t be the brother of themselves. | hasChild(?x, ?y), hasChild(?x, ?z), hasGender(?y, Feminine), notEqual(?y, ?z) —> isSisterOf(?y, ?z) | Meg – isSisterOf —> Chris |
isSiblingOf | An excellent—property of isBrotherOf and isSisterOf. OWL engines mechanically infers tremendous—properties | — | Chris – isSiblingOf —> Meg |
isNephewOf | A property that infers the aunts and uncles of youngsters based mostly on their gender. | isSiblingOf(?x, ?y), hasChild(?x, ?z), hasGender(?z, Male), notEqual(?y, ?x) —> isNephewOf(?z, ?y | Stewie – isNephewOf —> Carol |
isNieceOf | A property that infers the aunts and uncles of youngsters based mostly on their gender. | isSiblingOf(?x, ?y), hasChild(?x, ?z), hasGender(?z, Feminine), notEqual(?y, ?x) —> isNieceOf(?z, ?y) | Meg – isNieceOf —> Carol |
These axioms are imported right into a triple retailer, to which the engine will apply them to the specific details in actual—time. By means of these axioms, triple shops enable the querying of inferred/hidden triples.. Subsequently, if we wish to get the specific details about Chris Griffin, the next question might be executed:
SELECT ?p ?o WHERE {
?p ?o EXPLICIT true
}

If we have to get the inferred values for Chris, the SPARQL engine will present us with 10 inferred details:
SELECT ?p ?o WHERE {
?p ?o EXPLICIT false
}

This question will return all implicit details for Chris Griffin. The picture beneath reveals the found details. These should not explicitly saved within the triple retailer.

These outcomes couldn’t be produced by the property graph retailer, as no reasoning could possibly be utilized mechanically.
The RDF information mannequin empowers customers to find beforehand unknown details, a functionality that the LPG information mannequin lacks. Nonetheless, LPG implementations can bypass this limitation by growing advanced saved procedures. Nevertheless, not like in RDF, these saved procedures might have variations (if in any respect attainable) throughout completely different vendor implementations, rendering them non—transportable and impractical.
Take-home message
On this article, the RDF and LPG information fashions have been introduced objectively. On the one hand, the LPG information mannequin provides a speedy deployment of graph databases with out the necessity for a sophisticated schema to be outlined (i.e. it’s schema—much less). Conversely, the RDF information mannequin requires a extra time—consuming bootstrapping course of for graph information, or data graph, resulting from its schema definition requirement. Nevertheless, the choice to undertake one mannequin over the opposite ought to think about whether or not the extra effort is justified in offering significant context to the info. This consideration is influenced by particular use instances. For example, in social networks the place neighbourhood exploration is a main requirement, the LPG information mannequin could also be extra appropriate. However, for extra superior data graphs that necessitate reasoning or information integration throughout a number of sources, the RDF information mannequin is the popular alternative.
It’s essential to keep away from letting private preferences for question languages dictate the selection of knowledge mannequin. Regrettably, many articles accessible primarily function advertising instruments moderately than instructional assets, hindering adoption and creating confusion inside the graph database group. Moreover, within the period of plentiful and accessible info, it could be higher for distributors to chorus from selling misinformation about opposing information fashions. A basic false impression promoted by property graph evangelists is that the RDF information mannequin is overly advanced and educational, resulting in its dismissal. This assertion is predicated on a preferential prejudice. RDF is each a machine and human readable information mannequin that’s near enterprise language, particularly via the definition of schemas and ontologies. Furthermore, the adoption of the RDF information mannequin is widespread. For example, Google makes use of the RDF information mannequin as their customary to signify meta—details about net pages utilizing schema.org. There’s additionally the idea that the RDF information mannequin will completely perform with a schema. That is additionally a false impression, as in any case, the info outlined utilizing the RDF information mannequin may be schema—much less. Nevertheless, it’s acknowledged that each one semantics can be misplaced, and the info will probably be decreased to easily graph information. This text additionally mentions how the oneGraph imaginative and prescient goals to determine a bridge between the 2 information fashions.
To conclude, technical feasibility alone mustn’t drive implementation selections during which graph information mannequin to pick out. Decreasing greater—degree abstractions to primitive constructs typically will increase complexity and may impede fixing particular use instances successfully. Choices ought to be guided by use case necessities and efficiency concerns moderately than merely what’s technically attainable.
The writer wish to thank Matteo Casu for his enter and evaluate. This text is devoted to Norm Buddy, whose premature demise left a void within the Information Graph group.
1 Schemas and ontologies are used interchangeably on this article.
2 Lassila, O. et al. The OneGraph Imaginative and prescient: Challenges of Breaking the Graph Mannequin Lock—In. https://www.semantic-web-journal.net/system/files/swj3273.pdf.
3 Broekema, W. et al. openCypher Queries over Mixed RDF and LPG Information in Amazon Neptune. https://ceur-ws.org/Vol-3828/paper44.pdf.
4 https://www.w3.org/DesignIssues/LinkedData.html
5 https://www.go-fair.org/fair-principles