AtomGraph / Processor

Ontology-driven Linked Data processor and server for SPARQL backends. Apache License.
https://hub.docker.com/r/atomgraph/processor/
Apache License 2.0
58 stars 7 forks source link

Performance of inheritance annotation #13

Closed namedgraph closed 9 years ago

namedgraph commented 9 years ago

Currently OntologyProvider.inheritAnnotations() is using a very inefficient algorithm. Need to look into how SPIN does the same thing for spin:constraint and/or what utilities Jena provides to improve the performance.

SPIN takes an object-oriented world view on Semantic Web models, in which SPARQL queries play a similar role to functions and methods. Inheritance (expressed using rdfs:subClassOf) is treated in the sense that any query defined for superclasses will also be applied to subclasses. In other words, SPIN class descriptors can only "narrow down" and further restrict what has been defined further up in the class hierarchy. http://spinrdf.org/spin.html#spin-class-description

namedgraph commented 9 years ago

It could be possible to express the inheritance as Jena rules: https://jena.apache.org/documentation/inference/

namedgraph commented 9 years ago

[inheritance: (?class ?p ?o), (?p rdf:type owl:AnnotationProperty), (?subClass rdfs:subClassOf ?class), noValue(?subClass ?p) -> (?subClass ?p ?o) ]

namedgraph commented 9 years ago

[inheritance: (?class ?p ?o), (?p rdf:type owl:AnnotationProperty), (?p rdfs:isDefinedBy <http://graphity.org/gp#>), (?subClass rdfs:subClassOf ?class), noValue(?subClass ?p) -> (?subClass ?p ?o) ]

namedgraph commented 9 years ago

[gpInheritance: (?template rdf:type <http://graphity.org/gp#Template>), (?template ?p ?o), (?p rdf:type owl:AnnotationProperty), (?p rdfs:isDefinedBy <http://graphity.org/gp#>), (?subClass rdfs:subClassOf ?template), noValue(?subClass ?p) -> (?subClass ?p ?o) ] [spinInheritance: (?template rdf:type <http://graphity.org/gp#Template>), (?template <http://spinrdf.org/spin#constraint> ?o), (?subClass rdfs:subClassOf ?template), noValue(?subClass <http://spinrdf.org/spin#constraint>) -> (?subClass <http://spinrdf.org/spin#constraint> ?o) ]