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 isn’t any mutually unique alternative between RDF and LPG — they are often employed in conjunction. The suitable alternative is dependent upon the particular use case, and in some situations each fashions could also be essential; there isn’t any single information mannequin that’s universally relevant. In reality, polyglot persistence and multi—mannequin databases (databases that may help completely different information fashions inside the database engine or on high of the engine), are gaining reputation as enterprises recognise the significance of storing information in numerous codecs to maximise its worth and forestall stagnation. As an example, storing time sequence monetary information in a graph mannequin isn’t probably the most environment friendly method, because it may lead to minimal worth extraction in comparison with storing it in a time sequence matrix database, which allows speedy and multi—dimensional analytical queries.
The aim of this dialogue is to supply a complete comparability of RDF and Lpg information fashions, highlighting their distinct functions and overlapping utilization. Whereas articles usually current biased evaluations, selling their very own instruments, it’s important to acknowledge that these comparisons are sometimes flawed, as they evaluate apples to wheelbarrows fairly than apples to apples. This subjectivity can go away readers perplexed and unsure concerning the writer’s meant message. In distinction, this text goals to supply an goal evaluation, specializing in the strengths and weaknesses of each RDF and LPG information fashions, fairly than appearing as promotional materials for any software.
Fast recap of the info fashions
Each Rdf and LPG are descendants of the graph information mannequin, though they possess completely different constructions 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 method, 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 thing worth of Birkirkara. The worth node may both be a URI (distinctive useful resource identifier) or a datatype worth (comparable to integer or string). If the thing is a semantic URI, or as they’re additionally identified a useful resource, then the thing would result in different info, comparable to 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, inner 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 essential.
Then again, the LPG information mannequin encapsulates the set of vertices, edges, label project capabilities for vertices and edges, and key—worth property project operate for vertices and edges. For the earlier instance, the illustration could be as follows:
(particular person:Particular person {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 stated context.
Traditionally, the World Extensive 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 customers. Schemas1, or ontologies, function the inspiration 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 way of numerous 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 offers the low—degree constructs for outlining ontologies, such because the Particular person entity with properties title, gender, is aware of, and the anticipated sort of node. OWL offers constructs and mechanisms for formally defining ontologies by means of 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 info, SHACL was launched as a schema to validate constraints, higher often called information shapes (take into account it as “what ought to a Particular person include?”) in opposition to the data graph. Furthermore, by means of further options to the SHACL specs, guidelines and inference axioms can be outlined utilizing SHACL.
In abstract, schemas facilitate the enforcement of the suitable 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, comparable to 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. Nonetheless, this doesn’t negate the idea of flexibility. The RDF information mannequin is designed to accommodate the development, 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 affords 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 undertaking. Moreover, schemas are designed for reuse, and the RDF information mannequin facilitates this reusability. It’s noteworthy that an RDF—based mostly data graph usually encompasses each occasion information (comparable to “Giulia and Matteo are siblings”) and ontology/schema axioms (comparable to “Two persons are siblings after they have a mother or father in frequent”).
Nonetheless, the importance of ontologies extends past offering an information construction; additionally they impart semantic that means to the info. As an example, in developing a household tree, an ontology allows the express definition of relationships comparable to aunt, uncle, cousins, niece, nephew, ancestors, and descendants with out the necessity for the express information to be outlined within the data graph. Think about how this idea might be utilized in numerous pharmaceutical situations, simply to say one vertical area. Reasoning is a basic part that renders the RDF information mannequin a semantically highly effective mannequin for designing data graphs. Ontologies present a specific information level with all the mandatory context, together with its neighbourhood and its that means. As an 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 affords a extra agile and simple deployment of graph information. LPGs have lowered give attention to schemas (they solely help some constraints and “labels”/lessons). Graph databases adhering to the LPG information mannequin are identified for his or her velocity in making ready information for consumption because of its schema—much less nature. This makes them a extra appropriate alternative for information architects looking for to deploy their information in such a way. The LPG information mannequin is especially advantageous in situations the place information isn’t meant for development or important modifications. As an 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 offers the phantasm of offering semantics by means of node and edge labels and corresponding capabilities, it doesn’t inherently achieve this. LPG capabilities constantly return a map of values related to a node or edge. Nonetheless, that is basic when coping with use circumstances that must carry out quick graph algorithms as the info is offered instantly within the nodes and edges, and there’s no want for additional graph traversal.
Nonetheless, one basic characteristic of the LPG information mannequin is its ease and adaptability of attaching granular attributes or properties to both vertices or edges. As an 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 by means of numerous workarounds, comparable to reification, however this is able to 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 offers standardisation teams pertaining to the RDF information mannequin. As an example, a W3C working group is actively creating the RDF* customary, which includes the advanced relationship idea (attaching attributes to info/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. Nonetheless, the method of standardisation might be protracted, often 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 identical, distributors go for completely different question execution plans, equal to how any database engine (SQL or NoSQL) is carried out, to boost efficiency and velocity.
Most LPG graph implementations, though open supply, utilise proprietary or customized languages for storing and querying information, missing a typical adherence. This follow decreases interoperability and portability of knowledge between completely different distributors. Nonetheless, in latest months, ISO accepted 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 comparable to becoming information that’s meant to have hierarchical, advanced or arbitrary constructions. However, the proliferation of vendor—particular implementations overlooks an important performance – a standardised method to querying property graphs. Subsequently, it’s paramount that property graph distributors replicate their merchandise to this customary.
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 manner 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, making certain the advantages of each information fashions.
Different notable variations
Notable variations, largely in question languages, are there to help the info fashions. Nonetheless, we strongly argue in opposition to 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 affords a pure manner of supporting international distinctive useful resource identifiers (URIs), which manifest in three distinct traits. Inside the RDF area, a set of info described by an RDF assertion (i.e. s, p, o) having the identical topic URI is known as a useful resource. Knowledge saved in RDF graphs might be conveniently cut up into a number of named graphs, making certain that every graph encapsulates distinct considerations. As an 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 positioned in graphs hosted on completely different servers. Querying these exterior assets is facilitated by means of question federation inside the SPARQL protocol. Given the adoption of URIs, RDF embodies the unique imaginative and prescient of Linked Knowledge4, a imaginative and prescient that has since been adopted, to an extent, as a tenet within the FAIR ideas5, Knowledge Cloth, Knowledge 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, then again, are higher geared in the direction of path traversal queries, graph analytics and variable size path queries. While these functionalities might be thought of 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, by means of 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.
Knowledge Graph Patterns
The next part describes numerous information graph patterns and the way they’d match, or not, each information fashions mentioned on this article.
Sample | RDF information mannequin | LPG information mannequin |
International Definition of relations/properties | By way of schemas properties are globally outlined by means of numerous semantic properties comparable to area and ranges, algebraic properties comparable to inverse of, reflexive, transitive, and permit for informative annotations on properties definitions. | Semantics of relations (edges) isn’t supported in property graphs |
A number of Languages | String information can have a language tag connected to it and is taken into account when processing | Is usually a customized discipline or relationship (e.g. label_en, label_mt) however haven’t any particular remedy. |
Taxonomy – Hierarchy | Computerized inferencing, reasoning and may deal with advanced lessons. | Can mannequin hierarchies, however not mannequin hierarchies of lessons of people. Would require specific 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 by means of outlined class hierarchies. Moreover, the RDF information mannequin has the flexibility to signify subproperties. | Have to be dealt with in utility logic. |
N—ary Relations | Typically binary relationships are represented in triples, however N—ary relations might be finished through clean nodes, further assets, or reification. | Can usually be translated to further attributes on edges. |
Property Constraints and Validation | Obtainable by means of schema definitions: RDFS, OWL or SHACL. | Helps minimal constraints comparable to worth uniqueness however usually requires validation by means of schema layers or utility logic. |
Context and Provenance | May be finished in numerous methods, together with having a separate named graph and hyperlinks to the principle assets, or by means of 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 specific 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 appliance of RDF information mannequin and semantics inside an LPG utility might be present in numerous articles revealed on Medium, LinkedIn, and different blogs. As outlined within the earlier part, the LPG information mannequin isn’t particularly designed for reasoning functions. Reasoning entails making use of logical guidelines on current info as a strategy to deduce new data; that is essential because it helps uncover hidden relationships that weren’t explicitly said earlier than.
On this part we are going to display 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 because of 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 sequence Household Man.

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, now we have 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 start 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 routinely 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 routinely 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 | A brilliant—property of isBrotherOf and isSisterOf. OWL engines routinely 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 express info in actual—time. By way of these axioms, triple shops permit the querying of inferred/hidden triples.. Subsequently, if we wish to get the express details about Chris Griffin, the next question might be executed:
SELECT ?p ?o WHERE {
<http://instance.org/ChrisGriffin> ?p ?o EXPLICIT true
}

If we have to get the inferred values for Chris, the SPARQL engine will present us with 10 inferred info:
SELECT ?p ?o WHERE {
<http://instance.org/ChrisGriffin> ?p ?o EXPLICIT false
}

This question will return all implicit info for Chris Griffin. The picture under exhibits the found info. These are usually 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 routinely.
The RDF information mannequin empowers customers to find beforehand unknown info, a functionality that the LPG information mannequin lacks. However, LPG implementations can bypass this limitation by creating advanced saved procedures. Nonetheless, in contrast to in RDF, these saved procedures could have variations (if in any respect attainable) throughout completely different vendor implementations, rendering them non—moveable 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 affords 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, because of its schema definition requirement. Nonetheless, the choice to undertake one mannequin over the opposite ought to take into account whether or not the extra effort is justified in offering significant context to the info. This consideration is influenced by particular use circumstances. As an example, in social networks the place neighbourhood exploration is a main requirement, the LPG information mannequin could also be extra appropriate. Then again, 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 fairly than academic assets, hindering adoption and creating confusion inside the graph database group. Moreover, within the period of considerable and accessible data, it will be higher for distributors to chorus from selling misinformation about opposing information fashions. A common 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 by means of the definition of schemas and ontologies. Furthermore, the adoption of the RDF information mannequin is widespread. As an example, Google makes use of the RDF information mannequin as their customary to signify meta—details about internet pages utilizing schema.org. There may be additionally the idea that the RDF information mannequin will solely operate 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. Nonetheless, it’s acknowledged that every one semantics could be misplaced, and the info will probably be lowered 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 shouldn’t drive implementation choices wherein graph information mannequin to pick out. Decreasing increased—degree abstractions to primitive constructs usually will increase complexity and may impede fixing particular use circumstances successfully. Selections needs to be guided by use case necessities and efficiency concerns fairly than merely what’s technically attainable.
The writer wish to thank Matteo Casu for his enter and evaluate. This text is devoted to Norm Pal, 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.web/system/information/swj3273.pdf.
3 Broekema, W. et al. openCypher Queries over Mixed RDF and LPG Knowledge 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