{"id":19388865,"url":"https://github.com/linkml/owlstar","last_synced_at":"2026-02-04T15:40:13.664Z","repository":{"id":53705685,"uuid":"246228682","full_name":"linkml/owlstar","owner":"linkml","description":"Ontological Interpretations for Web Property Graphs","archived":false,"fork":false,"pushed_at":"2021-03-19T02:43:42.000Z","size":48,"stargazers_count":30,"open_issues_count":12,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-07T08:48:53.020Z","etag":null,"topics":["fol","knowledge-graph","logic","owl","probabilistic-models","rdf","rdfstar","semantics","semweb"],"latest_commit_sha":null,"homepage":"https://linkml.github.io/owlstar/","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-10T06:52:41.000Z","updated_at":"2024-11-26T19:42:30.000Z","dependencies_parsed_at":"2022-08-27T04:22:21.096Z","dependency_job_id":null,"html_url":"https://github.com/linkml/owlstar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Fowlstar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Fowlstar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Fowlstar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkml%2Fowlstar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkml","download_url":"https://codeload.github.com/linkml/owlstar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240549434,"owners_count":19819131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fol","knowledge-graph","logic","owl","probabilistic-models","rdf","rdfstar","semantics","semweb"],"created_at":"2024-11-10T10:13:54.882Z","updated_at":"2026-02-04T15:40:13.637Z","avatar_url":"https://github.com/linkml.png","language":"Makefile","readme":"# OWLStar: Ontological Interpretations for Web Property Graphs\n\nThis repo holds the [owlstar.ttl](owlstar.ttl) vocabulary. This\nproposed vocabulary allows edges in [Property Graphs](https://neo4j.com/developer/graph-database/) (e.g Neo4j, [RDF*](https://blog.liu.se/olafhartig/2019/01/10/position-statement-rdf-star-and-sparql-star/)) to be\naugmented with edge properties that specify ontological semantics,\nincluding (but not limited) to [OWL-DL](https://www.w3.org/TR/owl-primer/) interpretations.\n\nThis can also be used as an alternative to the [current OWL layering on RDF](https://www.w3.org/TR/owl2-mapping-to-rdf/).\n\nIt is designed to easily slot in to how people are currently managing\nrelationships between concepts in both knowledge graphs and\ntriplestores such as Wikidata.\n\nFor general background see: [proposed strategy for semantics in rdf* and property graphs](https://douroucouli.wordpress.com/2019/07/11/proposed-strategy-for-semantics-in-rdf-and-property-graphs/)\n\n## Browse Ontology Online\n\n * [owlstar.ttl](owlstar.ttl) - raw turtle files\n * https://cmungall.github.io/owlstar/ - owldoc rendition\n * TODO: online browser\n\n(currently none of these are ideal, I'm looking for better solutions)\n\n## Quick introduction\n\nthe idea is to be able to use Property Graphs (PGs) to encode ontological knowledge in a more precise way.\n\nWe use RDF* (RDFStar) as the property graph syntax. The idea is to\nwrite ontological assertions ([axioms](https://www.w3.org/TR/owl-primer/#Modeling_Knowledge:_Basic_Notions)) as single edges, such as:\n\n```turtle\n\u003c\u003c:finger :part-of :hand\u003e\u003e owlstar:interpretation owlstar:AllSomeInterpretation .\n```\n\nWhere `finger` and `hand` are classes (e.g from an ontology such as [uberon](http://obofoundry.org/ontology/uberon)), and the edge is to be interpreted as \"every finger is part of some hand\".\n\nThis could be encoded and visualized in a standard PG database such as Neo4j as:\n\n![img](https://douroucouli.files.wordpress.com/2019/07/mungalls-ontology-design-guidelines-8.png)\n\nIt could also be rendered in plain RDF (RDF* is syntatic sugar for reification)\n\nThis would be interpreted as the following OWL axiom (written here in [Manchester syntax](https://www.w3.org/TR/owl2-manchester-syntax/)):\n\n```owl\n:finger rdfs:subClassOf :part-of some :hand\n```\n\nThe more verbose representation in plain RDF:\n\n```turtle\n:finger rdfs:subClassOf [\n  a owl:Restriction ;\n  owl:onProperty :part-of ;\n  owl:someValuesFrom :hand\n]\n```\n\n## Why not use RDF OWL layering?\n\nThe existing [OWL layering on RDF](https://www.w3.org/TR/owl2-mapping-to-rdf/) is verbose and does not preserve\ndesirable graph characteristics such as the `finger` and `hand` being\nconnected by a single edge.\n\nConsider the ontology in (A) below. Compare the very verbose standard layering (B) with a more intuitive and compact graph representation (C):\n\n![img](https://douroucouli.files.wordpress.com/2019/07/z.png)\n\nThe RDF graph in B is obviously very verbose and unintuitive from a user\nperspective. Also it makes certain kinds of logic such as graph\ntraversal over partonomies more difficult to implement.\n\nNote that many resources therefore choose to encode ontologies using a\nscheme like (C), but they typically do this in an unprincipled ad-hoc\nway. owlstar is an attempt to provide a formal way to do C.\n\n## OWLStar as a proposed standard\n\nThis repo contains the owlstar 'ontology' as a turtle file: [owlstar.ttl](owlstar.ttl)\n\nThis is best viewed in Protege, or as a text file.\n\nThe URIs are not yet resolvable\n\nThe ontology is intended to be self-documenting but the basic idea is\nthat OWL Axioms can be encoded as far as possible in the most compact\ngraph form, using edge properties to encode semantics.\n\nFor example, the ontology contains the class `AllSomeInterpetation`:\n\n```\nos:AllSomeInterpretation rdfs:subClassOf os:LogicalInterpretation ;\n  rdfs:label \"all-some interpretation modifier\" ;\n  dc:description \"A modifier on a triple that causes the triple to be interpreted as an all-some statement\" ;\n  os:example \"\u003c\u003cfinger part-of hand\u003e\u003e os:interpretation os:AllSomeInterpretation -\u003e finger rdfs:subClassOf [a owl:Restriction ; owl:onProperty part-of ; owl:someValuesFrom hand]\" ;\n  os:owlMapping \"\u003c\u003c?s ?p ?o\u003e\u003e os:interpretation os:AllSomeInterpretation -\u003e ?s rdfs:subClassOf [a owl:Restriction ; owl:onProperty ?p ; owl:someValuesFrom ?o]\" .\n```\n\nThe `owlMapping` triple specifies how an edge that has this as a property is to be interpreted (the target is an RDF graph that follows the usual OWL over RDF interpretation). E.g. the edge:\n\n```turtle\n\u003c\u003c:finger :part-of :hand\u003e\u003e owlstar:interpretation owlstar:AllSomeInterpretation .\n```\n\nHas bindings:\n\n * `?s` = :finger\n * `?p` = :part-of\n * `?o` = :object\n\nSo the RDF* edge would be translated to:\n\n```turtle\n?s rdfs:subClassOf [a owl:Restriction ; owl:onProperty ?p ; owl:someValuesFrom ?o]\n```\n\nFor cases where the PG is encoded in RDFStar or RDF (the former being\nsyntactic sugar for the latter), it should be straightforward to\nimplement owlMapping using SPARQLStar or SPARQL constructs (the latter\nusing the reification vocabulary).\n\nAt this time a complete mapping for all of OWL is not complete. We have focused on common constructs.\n\n## Advanced Use Cases\n\nThe main driving use case for owlstar is compact encoding of widely\nused OWL constructs. The same principles could be used to compactly\nencode formal interpretations that go outside OWL-DL, including\ntemporal, contextual logic, and probabilistic logic.\n\n### Temporal and Contextual Logic\n\nSee `owlstar:context` in the vocabulary\n\nSee also: IKL\n\nThe basic idea is to encode contextual information about a statement's interpretation using `os:context`, for example:\n\n```\n\u003c\u003c:johnsHeart a :BeatingHeart\u003e\u003e os:context :t1 .\n\u003c\u003c:johnsHeart :part-of :john\u003e\u003e os:context :t1 .\n:t1 a bfo:TemporalRegion .\n```\n\n(here the intent is to represent a state of affairs at a particular\ntime, and that state of affairs may change - e.g. johns heart may\ncease to beat, or it may be transplanted and part of a different\nperson).\n\nThere are different possibilities for interpreting this in First Order Logic, e.g.\n\n```\ntype(johnsHeart, BeatingHeart, t1)\npart_of(johnsHeart, john, t1)\ntype(t1, TemporalRegion)\n```\n\nAlthough there are other ways: [IKL](http://www.ihmc.us/users/phayes/IKL/GUIDE/GUIDE.html) contexts, fluents, ...\n\nThere are also different schemes/aaptterns for representing these\nusing OWL binary predicates, but these tend to be more verbose than\nthe PG representation, and some suffer from complex problems (e.g. [temporalized relations](https://github.com/cmungall/trel-crit) ).\n\nWe can also easily encode complex FOL axioms using simple graph edges; e.g.\n\n```\n\u003c\u003cnucleus part-of cell\u003e\u003e os:interpretation os:AllSomeAllTimesInterpretation .\n```\n\nThis is interpreted as: for every nucleus n, if n exists at t, then there exists some cell c, and n is part of c at t\n\nSee [RO 2005 paper](https://genomebiology.biomedcentral.com/articles/10.1186/gb-2005-6-5-r46).\n\nSee also: [RO Wiki](https://github.com/oborel/obo-relations/wiki/ROAndTime)\n\n\n\n### Probabilistic\n\nIn a PG it is natural to annotate edges with confidence or prabiilities, e.g:\n\n```\n\u003c\u003c:bob foaf:friendOf :alice\u003e\u003e os:probability 0.9 ^^ xsd:float .\n```\n\n(Note that although we use RDF* for syntax, this doesn't work with RDF semantics, see below for discussion)\n\nvisual depiction:\n\n![img](https://douroucouli.files.wordpress.com/2019/07/mungalls-ontology-design-guidelines-7.png)\n\nInterpretation:\n\n```\nPr( :bob foaf:friendOf :alice ) = 0.9\n```\n\nNote this can be combined with OWL interpretations, e.g:\n\n```\n\u003c\u003c:CommonCold :has-symptom :RunnyNode\u003e\u003e \n   owlstar:interpretation owlstar:AllSomeInterpretation ;\n   owlstar:probability 0.95 .\n```\n\nTODO: elucidate difference between probability of axiom being true via axiom holding for any instance of a cold with a probability of 0.95\n\nMost likely approach is a mapping to CL/[IKL](http://www.ihmc.us/users/phayes/IKL/GUIDE/GUIDE.html) structures, e.g.\n\n```\n(probability (that (friend-of bob alice)) 0.)9\n```\n\n### Other OWL axioms\n\nTODO: compact encoding of GCIs. E.g. `has-diagnosis some Cold SubClassOf has-symptom some Coughing and infected-by some Rhinovirus`\n\n## Semantics\n\n__IMPORTANT NOTE__:\nWe ignore RDF semantics and treat RDF* as a syntactic encoding of property graph structures.\n\nSemantics are specified in the [owlstar.ttl](owlstar.ttl) vocabulary, via the `owlstar:owlMapping` and `owlstar:folMapping` predicates.\n\nThe OWL mapping maps between RDF* structures and RDF triples that have an OWL interpretation through the standard OWL2-RDF mapping\n\nThe FOL mapping maps between RDF* structures and Common Logic. TODO elucidate this more.\n\nThe decision to ignore RDF semantics in the target graph may be seen as drastic, but this is both justified and has limited consequences:\n\n - it is necessary for a compact graph representation, as RDF interpretation of the above RDF* examples will have inconsistent interpretations\n - For most practical purposes, RDF is used as a datamodel, not semantics. When semantics are required we transform to OWL\n\n## Mapping OWL to Neo4J and other graph databases.\n\nowlstar takes care of the mapping of OWL-DL to RDF*. As far as I am\naware there is no official mapping of RDF* to Neo4J, but this would\nlikely be straightforward, with a few caveats. Composing these two\nmappings would give a mapping from OWL to Neo4J.\n\nA mapping from RDF* to Neo4J may look like:\n\n * There would be a one-to-one mapping between RDF* nodes and Neo4J nodes\n * A variety of schemes could be used to map the URI\n     * a `uri` node property\n     * an `id` or `curie` node property with the CURIEfied URI (assuming global prefix map)\n     * both of the above\n * There would be a one-to-one mapping between RDF* edges and Neo4J edges\n * Triples where the subject is a RDF* node and the object is a literal would map to node properties\n * Triples where the subject is a RDF* edge and the object is a literal would map to edge properties\n * Triples where the subject is a RDF* edge and the object is a node would also map to edge properties\n      * note that Neo4J does not support true hypergraphs - there is no way to directly point to a node\n      * instead the URI of the object would be the property value\n * Blank nodes could be treated as any other RDF* nodes (but these would be less common with owlstar)\n\nA similar approach could be tried for other graph databases, but these\nmay differ in their data model. E.g. some may allow true hypergraphs.\n\n\n## TODO\n\nSee [milestones](https://github.com/cmungall/owlstar/milestones)\n\n## FAQ\n\nTODO\n\n## See Also\n\n - [RDF*](https://blog.liu.se/olafhartig/2019/01/10/position-statement-rdf-star-and-sparql-star/)\n - [proposed strategy for semantics in rdf* and property graphs](https://douroucouli.wordpress.com/2019/07/11/proposed-strategy-for-semantics-in-rdf-and-property-graphs/)\n - [obographs](https://douroucouli.wordpress.com/2016/10/04/a-developer-friendly-json-exchange-format-for-ontologies/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkml%2Fowlstar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkml%2Fowlstar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkml%2Fowlstar/lists"}