• Michael DeBellis

Semantic Web vs. Property Graphs

A question that I often hear is whether developers should use property graphs or the Semantic Web stack. Property graphs, especially Neo4j and Cypher, have received a lot of attention recently and Neo4j is an excellent product but I think there are many good reasons for using the Semantic Web stack.


First, to be clear property graphs provide about the same functionality as RDF. Both are languages for defining graphs, both have a query language specifically designed for their graphs (Cypher and SPARQL). The main differentiator for property graphs over RDF is the ability to have attributes/relations on properties. This is definitely a useful feature. Rather than being restricted to binary relations as you are with OWL, with property graphs you can have n-ary relations. However, there is a design pattern that most object-oriented programmers are already familiar with that enables you to create the same functionality by creating a new class to represent the n-ary relation. I discuss this pattern in a previous blog post. There is no question that compared to having native support for n-ary relations the design pattern is not as elegant. The reason that the designers of OWL didn't include this capability is that it would cause the reasoners to be too slow. However, consider all the things that the Semantic Web stack has that property graphs don't:

  • Formal Semantics. OWL is a language built on RDF that is at a higher level than a graph. It has a formal semantics that is a decidable subset of First Order Logic. That means that automated reasoners can validate an ontology to make sure it has no contradictions. What's more if the ontology is free of contradictions the reasoner can then do a great deal of automatic inferencing such as maintain inverse and transitive values, restructure the class hierarchy, recognize the type(s) of an instance based on its values and countless others.

  • Linked Data. SPARQL can do queries against any W3C compliant knowledge graph that is published on the Internet. There are hundreds of such sources with petabytes of useful, structured, free data such as DBpedia, HealthData.gov, and Geonames. These knowledge graphs are known as Linked Data. A SPARQL query can do joins with data from any Linked Data knowledge graph. This essentially gives your computer access to a huge distributed database with petabytes of global data.

  • Industry Vocabularies. Because OWL and RDF are W3C standards, there are hundreds of industry vertical vocabularies (reusable ontologies) in OWL and RDF. Just a few examples are SNOMED for Healthcare, FIBO for financial services, Friend of a Friend (FOAF) for social networking, and Schema.org for general business.

  • Technical Vocabularies. There are also hundreds of horizontal vocabularies for technical domains created by the W3C as well as other organizations. Examples include Dublin Core for metadata, Prov-O for provenance data, and the Simple Knowledge Organization System (SKOS) for knowledge organization and categorization.

  • The Semantic Web Stack. The Semantic Web stack includes many other technologies as well. As already described above there is the OWL language that is a higher level than the graph level that RDF and property graphs work at. There is also the Shapes Constraint Language (SHACL) for defining and enforcing data integrity constraints, and the Semantic Web Rule Language (SWRL) that provides a very powerful forward chaining rule engine.

  • Standards help future proof your IT infrastructure. Property graphs are not based on any standard. So if you use Neo4j you are essentially locked into one vendor. The Semantic Web on the other hand has many different vendors, some are free and open source such as Protégé , Apache Jenna, and Owlready2 while others are commercial products such as AllegroGraph, Stardog, Pool Party, and Ontotext. Because these tools all conform to the W3C standards it is much less painful to integrate with or migrate from one vendor or open source platform to another. With a product such as Neo4j that is not a standard you are locked into using them unless you are willing to commit a significant effort to transform from their language to a new one. The more you use it the harder it becomes to transition to a different platform. With W3C standard compliant tools you can easily go from one standards compliant tool to another. On the CODO project we utilized Protégé, Web Protégé, and AllegroGraph. Each one provided different strengths. Protégé for ontology development, Web Protégé for us to share our work, and AllegroGraph to scale up and visualize large amount of data about the Covid pandemic.

Of course, no technology is the best fit for every use case. However, it seems to me that in the vast majority of cases the functionality for the Semantic Web significantly outweigh those for property graphs.



505 views1 comment