In years, there was a proliferation of articles, LinkedIn posts, and advertising supplies presenting graph information fashions from totally 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 a mutually unique selection between RDF and LPG — they are often employed in conjunction. The suitable selection relies on the particular use case, and in some situations each fashions could also be mandatory; there isn’t a single information mannequin that’s universally relevant. Actually, polyglot persistence and multi—mannequin databases (databases that may help totally different information fashions throughout 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. As an illustration, storing time sequence monetary information in a graph mannequin isn’t probably the most environment friendly strategy, because it might 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 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 evaluate apples to wheelbarrows slightly than apples to apples. This subjectivity can go away readers perplexed and unsure concerning the creator’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, slightly than performing as promotional materials for any instrument.
Fast recap of the info fashions
Each Rdf and LPG are descendants of the graph information mannequin, though they possess totally different constructions and traits. A graph includes vertices (nodes) and edges that join two vertices. Numerous 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 might be 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. Take into account the next easy instance: Jeremy was born in Birkirkara. This sentence could be represented as an RDF assertion or truth with the next construction — Jeremy is a topic useful resource, the predicate (relation) is born in, and the article worth of Birkirkara. The worth node might both be a URI (distinctive useful resource identifier) or a datatype worth (reminiscent of integer or string). If the article is a semantic URI, or as they’re additionally identified a useful resource, then the article would result in different information, 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 every other RDF graph, inside or exterior. As soon as a useful resource is outlined and a URI is “minted”, this URI turns into immediately out there and can be utilized in any context that’s deemed mandatory.
Then again, the LPG information mannequin encapsulates the set of vertices, edges, label task features for vertices and edges, and key—worth property task 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 related 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 information, enabling each people and machines to interpret the context of the info and any relationships within the stated context.
Traditionally, the World Broad Internet Consortium (W3C) established the Useful resource Description Framework (RDF) information mannequin as a standardised framework for information alternate throughout the Internet. 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 could be outlined. This functionality makes information integration one of many quite a few appropriate functions of the RDF information mannequin. By numerous W3C teams, requirements had been established on how schemas and ontologies could be outlined, primarily RDF Schema (RDFS), Internet Ontology Language (OWL), and not too long ago SHACL. RDFS supplies the low—stage 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 by way of axioms and guidelines, enabling the inference of implicit information. While OWL axioms are taken as a part of the information graph and used to deduce further information, SHACL was launched as a schema to validate constraints, higher often known as information shapes (take into account it as “what ought to a Individual include?”) in opposition to the information graph. Furthermore, by way of further options to the SHACL specs, guidelines and inference axioms will also be outlined utilizing SHACL.
In abstract, schemas facilitate the enforcement of the correct occasion information. That is attainable as a result of the RDF permits any worth to be outlined inside a truth, offered it adheres to the specs. Validators, reminiscent of in—constructed SHACL engines or OWL constructs, are chargeable 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 information throughout the schema’s boundaries. Consequently, whereas an RDF information mannequin strongly encourages using schemas (or ontologies) as its basis, specialists discourage the creation of ivory tower ontologies. This endeavour does require an upfront effort and collaboration with area specialists to assemble an ontology that precisely displays the use case and the info that might be saved within the information 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 venture. Moreover, schemas are designed for reuse, and the RDF information mannequin facilitates this reusability. It’s noteworthy that an RDF—based mostly information graph usually encompasses each occasion information (reminiscent of “Giulia and Matteo are siblings”) and ontology/schema axioms (reminiscent of “Two persons are siblings after they have a mother or father in frequent”).
Nonetheless, the importance of ontologies extends past offering an information construction; in addition they impart semantic that means to the info. As an illustration, 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 information graph. Take into account how this idea could 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 information graphs. Ontologies present a selected information level with all the mandatory context, together with its neighbourhood and its that means. As an illustration, 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 easy deployment of graph information. LPGs have diminished deal with schemas (they solely help some constraints and “labels”/courses). Graph databases adhering to the LPG information mannequin are identified for his or her velocity in making ready information for consumption as a result of its schema—much less nature. This makes them a extra appropriate selection 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 isn’t supposed for development or important adjustments. As an illustration, 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 by way of node and edge labels and corresponding features, it doesn’t inherently accomplish that. LPG features persistently return a map of values related to a node or edge. Nonetheless, that is basic when coping with use instances that must carry out quick graph algorithms as the info is offered straight 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 illustration, 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 might obtain this by way of numerous workarounds, reminiscent of reification, however this could lead to extra complicated 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. As an illustration, a W3C working group is actively creating the RDF* normal, which includes the complicated relationship idea (attaching attributes to information/triples) throughout the RDF information mannequin. This normal 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 could be protracted, continuously leading to delays that go away such distributors at an obstacle.
Nonetheless, requirements facilitate a lot—wanted interoperability. Data Graphs constructed upon the RDF information mannequin could be simply ported between totally different functions and triple retailer, as they haven’t any vendor lock—in, and standardisation codecs are offered. Equally, they are often queried with one normal question language known as SPARQL, which is utilized by the totally different distributors. While the question language is similar, distributors go for totally different question execution plans, equal to how any database engine (SQL or NoSQL) is applied, to reinforce efficiency and velocity.
Most LPG graph implementations, though open supply, utilise proprietary or customized languages for storing and querying information, missing a regular adherence. This apply decreases interoperability and portability of information between totally different distributors. Nonetheless, in latest months, ISO permitted 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, complicated or arbitrary constructions. 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 normal.
Not too long ago, 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 approach 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’ll talk about a number of the variations right here for a extra full overview.
The RDF information mannequin provides a pure approach of supporting international distinctive useful resource identifiers (URIs), which manifest in three distinct traits. Inside the RDF area, a set of information 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 could be conveniently break up into a number of named graphs, making certain that every graph encapsulates distinct considerations. As an illustration, 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 could be seamlessly executed throughout these a number of graphs. Moreover, graphs can set up interlinks with assets positioned in graphs hosted on totally different servers. Querying these exterior assets is facilitated by way of question federation throughout 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 guideline within the FAIR ideas5, Information Material, 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, however, are higher geared in direction of path traversal queries, graph analytics and variable size path queries. While these functionalities could 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, by way 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 won’t incorporate this characteristic both.
Information Graph Patterns
The next part describes numerous 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 schemas properties are globally outlined by way of numerous 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) 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 discipline or relationship (e.g. label_en, label_mt) however haven’t any particular therapy. |
Taxonomy – Hierarchy | Computerized inferencing, reasoning and might deal with complicated courses. | Can mannequin hierarchies, however not mannequin hierarchies of courses of people. Would require specific traversal of classification hierarchies |
Particular person Relationships | Requires workarounds like reification and complicated queries. | Could make direct assertions over them, pure illustration and environment friendly querying. |
Property Inheritance | Properties inherited by way of outlined class hierarchies. Moreover, the RDF information mannequin has the flexibility to signify subproperties. | Should be dealt with in software logic. |
N—ary Relations | Typically binary relationships are represented in triples, however N—ary relations could be executed through clean nodes, further assets, or reification. | Can typically be translated to further attributes on edges. |
Property Constraints and Validation | Accessible by way of schema definitions: RDFS, OWL or SHACL. | Helps minimal constraints reminiscent of worth uniqueness however typically requires validation by way of schema layers or software logic. |
Context and Provenance | May be executed in numerous methods, together with having a separate named graph and hyperlinks to the principle assets, or by way of reification. | Can add properties to nodes and edges to seize context and provenance. |
Inferencing | Automate the inferencing of inverse relationships, transitive patterns, complicated property chains, disjointness and negation. | Both require specific definition, in software 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 software could 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 information as a solution to deduce new information; that is necessary because it helps uncover hidden relationships that weren’t explicitly acknowledged earlier than.
On this part we’ll reveal 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 as a result of its hierarchical construction and its flexibility in being outlined inside any information mannequin. For this demonstration, we’ll 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 known 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 will begin defining the next properties, whose information could be deduced from the preliminary information. We introduce the next properties:
Property | Remark | Axiom | Instance |
isAncestorOf | A transitive property which can 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 identical 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 identical 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 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 specific information in actual—time. By these axioms, triple shops enable the querying of inferred/hidden triples.. Subsequently, if we need to get the specific details about Chris Griffin, the next question could 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 information:
SELECT ?p ?o WHERE {
?p ?o EXPLICIT false
}

This question will return all implicit information for Chris Griffin. The picture beneath exhibits the found information. These will not be explicitly saved within the triple retailer.

These outcomes couldn’t be produced by the property graph retailer, as no reasoning may very well be utilized routinely.
The RDF information mannequin empowers customers to find beforehand unknown information, a functionality that the LPG information mannequin lacks. Nonetheless, LPG implementations can bypass this limitation by creating complicated saved procedures. Nonetheless, in contrast to in RDF, these saved procedures could have variations (if in any respect attainable) throughout totally 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 provides a speedy deployment of graph databases with out the necessity for a complicated 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 information graph, as a result 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 instances. As an illustration, in social networks the place neighbourhood exploration is a major requirement, the LPG information mannequin could also be extra appropriate. Then again, for extra superior information graphs that necessitate reasoning or information integration throughout a number of sources, the RDF information mannequin is the popular selection.
It’s essential to keep away from letting private preferences for question languages dictate the selection of information mannequin. Regrettably, many articles out there primarily function advertising instruments slightly than instructional assets, hindering adoption and creating confusion throughout the graph database group. Moreover, within the period of ample and accessible data, 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 complicated 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 way of the definition of schemas and ontologies. Furthermore, the adoption of the RDF information mannequin is widespread. As an illustration, Google makes use of the RDF information mannequin as their normal to signify meta—details about net pages utilizing schema.org. There’s additionally the belief 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. Nonetheless, it’s acknowledged that each one semantics can be misplaced, and the info might be diminished 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. Decreasing larger—stage abstractions to primitive constructs typically will increase complexity and might impede fixing particular use instances successfully. Selections ought to be guided by use case necessities and efficiency concerns slightly than merely what’s technically attainable.
The creator wish to thank Matteo Casu for his enter and assessment. This text is devoted to Norm Pal, whose premature demise left a void within the Data 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.internet/system/information/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