Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Programming semantics: practical applications of OTTR

81 views

Published on

Ongoing work on Reasonable Ontology Templates (OTTR). The talk will continue the discussion on OTTR, which has been presented in previous colloquium talks. This time the focus is on the practical aspects of using OTTR templates to build and use and maintain ontologies.

Particularly the following features will be presented:
• multiple input and output languages/serialisations for templates: wOTTR for RDF; stOTTR, which is a human readable and concise syntax; and tabOTTR which is a tabular syntax for template instances; and SPARQL queries generated from OTTR templates
• support for types to ensure consistent use of template variables across all instances in a template body.
• library analysis, such as detection of common patterns used in modeling of a domain that is not captured by any template in the library. This can be used to improve the template definitions resulting in a more concise template library that is easier to maintain and closer to the user's conceptualisation of the domain.

Information and papers on OTTR are available at http://www.ottr.xyz/ :
OTTRs are OWL ontology macros capable of representing ontology design patterns and closely integrating their use into ontology engineering. A template is itself an RDF graph or an OWL ontology, annotated with a special purpose OWL vocabulary. This allows templates to be edited, debugged, published, identified, instantiated, composed, used as queries and bulk transformations, and maintained; all leveraging existing W3C standards, best practices and tools.

Leif Harald Karlsen is currently finishing his PhD thesis at the group for Logic and Intelligent Data at Ifi and is a member of the OTTR development team at UiO.

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

Programming semantics: practical applications of OTTR

  1. 1. 1/25 Programming semantics: practical applications of OTTR Leif Harald Karlsen April 16, 2018
  2. 2. 2/25 Reasonable Ontology Templates (OTTR) Can be viewed as a macro language for knowledge bases Abstractions over RDF and OWL hiding complexity and providing friendly interfaces Build and interact with ontologies via templates DRY: Do not Repeat Yourself Uniform modelling Completeness of input Leverage existing W3C stack and tools OTTR
  3. 3. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no .
  4. 4. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no . ?name rdf:type owl:Class . ?name rdfs:subClassOf :Pizza . ?name rdfs:label ?label .
  5. 5. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no . PIZZA(?name, ?label) :: ?name rdf:type owl:Class . ?name rdfs:subClassOf :Pizza . ?name rdfs:label ?label .
  6. 6. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no . PIZZA(?name, ?label) :: TRIPLE(?name, rdf:type, owl:Class), TRIPLE(?name, rdfs:subClassOf, :Pizza), TRIPLE(?name, rdfs:label, ?label) .
  7. 7. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no . PIZZA(?name, ?label) :: TRIPLE(?name, rdf:type, owl:Class), TRIPLE(?name, rdfs:subClassOf, :Pizza), TRIPLE(?name, rdfs:label, ?label) . PIZZA(:Margherita, "Margherita"@it) . PIZZA(:AmericanHot, "American Hot"@en) . PIZZA(:Grandiosa, "Grandiosa"@no) .
  8. 8. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no . PIZZA(?name, ?label) :: TRIPLE(?name, rdf:type, owl:Class), TRIPLE(?name, rdfs:subClassOf, :Pizza), TRIPLE(?name, rdfs:label, ?label) . SUBCLASSOF(?sub, ?super) :: TRIPLE(?sub, rdfs:subClassOf, ?super) . PIZZA(:Margherita, "Margherita"@it) . PIZZA(:AmericanHot, "American Hot"@en) . PIZZA(:Grandiosa, "Grandiosa"@no) .
  9. 9. 3/25 Basic idea :Margherita rdf:type owl:Class . :Margherita rdfs:subClassOf :Pizza . :Margherita rdfs:label "Margherita"@it . :AmericanHot rdf:type owl:Class . :AmericanHot rdfs:subClassOf :Pizza . :AmericanHot rdfs:label "American Hot"@en . :Grandiosa rdf:type owl:Class . :Grandiosa rdfs:subClassOf :Pizza . :Grandiosa rdfs:label "Grandiosa"@no . PIZZA(?name, ?label) :: TRIPLE(?name, rdf:type, owl:Class), SUBCLASSOF(?name, :Pizza), TRIPLE(?name, rdfs:label, ?label) . SUBCLASSOF(?sub, ?super) :: TRIPLE(?sub, rdfs:subClassOf, ?super) . PIZZA(:Margherita, "Margherita"@it) . PIZZA(:AmericanHot, "American Hot"@en) . PIZZA(:Grandiosa, "Grandiosa"@no) .
  10. 10. 4/25 OTTR Templates head SUBCLASSOF name (?sub, ?super parameters ) :: body TRIPLE(?sub, rdfs:subClassOf, ?super) instance .
  11. 11. 4/25 OTTR Templates head SUBCLASSOF name (?sub , ?super parameters ) :: body TRIPLE(?sub, rdfs:subClassOf, ?super) instance . The parameters each have a type and a cardinality.
  12. 12. 4/25 OTTR Templates head SUBCLASSOF name (?sub : 1 class, ?super : 1 class parameters ) :: body TRIPLE(?sub, rdfs:subClassOf, ?super) instance . The parameters each have a type and a cardinality.
  13. 13. 5/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) .
  14. 14. 5/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . NAMEDPIZZA(:Margherita, :Italy, :Tomato, :Mozzerella )
  15. 15. 5/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . NAMEDPIZZA(:Margherita, :Italy, :Tomato, :Mozzerella ) SUBCLASSOF(:Margherita, :NamedPizza), SUBOBJECTHASVALUE(:Margherita, :hasCountry, :Italy), SUBOBJECTALLVALUESFROM(:Margherita, :hasTopping, _:b2), OBJECTUNIONOF(_:b2, :Tomato, :Mozzerella ), x | SUBOBJECTSOMEVALUESFROM(:Margherita, :hasTopping, :Tomato, :Mozzerella ) .
  16. 16. 6/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . SUBCLASSOF(:Margherita, :NamedPizza), SUBOBJECTHASVALUE(:Margherita, :hasCountry, :Italy), SUBOBJECTALLVALUESFROM(:Margherita, :hasTopping, _:b2), OBJECTUNIONOF(_:b2, :Tomato, :Mozzerella ), x | SUBOBJECTSOMEVALUESFROM(:Margherita, :hasTopping, :Tomato, :Mozzerella ) .
  17. 17. 6/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . SUBCLASSOF(:Margherita, :NamedPizza), SUBOBJECTHASVALUE(:Margherita, :hasCountry, :Italy), SUBOBJECTALLVALUESFROM(:Margherita, :hasTopping, _:b2), OBJECTUNIONOF(_:b2, :Tomato, :Mozzerella ), x | SUBOBJECTSOMEVALUESFROM(:Margherita, :hasTopping, :Tomato, :Mozzerella ) . SUBCLASSOF(:Margherita, :NamedPizza), SUBOBJECTHASVALUE(:Margherita, :hasCountry, :Italy), SUBOBJECTALLVALUESFROM(:Margherita, :hasTopping, _:b2), OBJECTUNIONOF(_:b2, :Tomato, :Mozzerella ), SUBOBJECTSOMEVALUESFROM(:Margherita, :hasTopping, :Tomato), SUBOBJECTSOMEVALUESFROM(:Margherita, :hasTopping, :Mozzerella) .
  18. 18. 7/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . NAMEDPIZZA(:Grandiosa, none, :Tomato, :Jarlsberg, :Ham, :SweetPepper )
  19. 19. 7/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . NAMEDPIZZA(:Grandiosa, none, :Tomato, :Jarlsberg, :Ham, :SweetPepper ) SUBCLASSOF(:Grandiosa, :NamedPizza), SUBOBJECTHASVALUE(:Grandiosa, :hasCountry, none), SUBOBJECTALLVALUESFROM(:Grandiosa, :hasTopping, _:b2), OBJECTUNIONOF(_:b2, :Tomato, :Jarlsberg, :Ham, :SweetPepper ), x | SUBOBJECTSOMEVALUESFROM(:Grandiosa, :hasTopping, :Tomato, :Jarlsberg, :Ham, :SweetPepper ) .
  20. 20. 7/25 More complex example SUBOBJECTALLVALUESFROM(?x : 1 class, ?Property : 1 objectProperty, ?Range : 1 class) :: SUBCLASSOF(?x, _:b1), OBJECTALLVALUESFROM(_:b1, ?Property, ?Range) . NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . NAMEDPIZZA(:Grandiosa, none, :Tomato, :Jarlsberg, :Ham, :SweetPepper ) SUBCLASSOF(:Grandiosa, :NamedPizza), SUBOBJECTHASVALUE(:Grandiosa, :hasCountry, none), SUBOBJECTALLVALUESFROM(:Grandiosa, :hasTopping, _:b2), OBJECTUNIONOF(_:b2, :Tomato, :Jarlsberg, :Ham, :SweetPepper ), x | SUBOBJECTSOMEVALUESFROM(:Grandiosa, :hasTopping, :Tomato, :Jarlsberg, :Ham, :SweetPepper ) .
  21. 21. 8/25 Languages supported: Definitions stOTTR: NAMEDPIZZA( ?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings) . wOTTR: <http://draft.ottr.xyz/pizza/NamedPizza> a ottr:Template ; ottr:hasParameter [ ottr:index 1 ; ottr:classVariable :pizza ] , [ ottr:index 2 ; ottr:individualVariable :country; ottr:optional true ] , [ ottr:index 3 ; ottr:listVariable (:toppings) ] . ### body: [] ottr:templateRef t-owl-axiom:SubClassOf ; ottr:withValues ( :pizza p:NamedPizza ) . [] ottr:templateRef t-owl-axiom:SubObjectHasValue ; ottr:withValues ( :pizza p:hasCountryOfOrigin :country ) . [] ottr:templateRef t-owl-axiom:SubObjectAllValuesFrom ; ottr:withValues ( :pizza p:hasTopping _:alltoppings ) . [] ottr:templateRef t-owl-rstr:ObjectUnionOf ; ottr:withValues ( _:alltoppings (:toppings) ) . [] ottr:templateRef t-owl-axiom:SubObjectSomeValuesFrom ; ottr:hasArgument [ ottr:index 1; ottr:value :pizza ] , [ ottr:index 2; ottr:value p:hasTopping ] , [ ottr:index 3; ottr:eachValue (:toppings) ] .
  22. 22. 9/25 Languages supported: Instances stOTTR: NAMEDPIZZA(:Margherita, :Italy, :Tomato, :Mozzerella ) NAMEDPIZZA(:Grandiosa, none, :Tomato, :Jarlsberg, :Ham, :SweetPepper ) wOTTR [] a ottr:TemplateInstance ; ottr:templateRef :NamedPizza ; ottr:arguments ( :Margherita :Italy ( :Tomato :Mozzerella ) ) . [] a ottr:TemplateInstance ; ottr:templateRef :NamedPizza ; ottr:arguments ( :Grandiosa ottr:none ( :Tomato :Jarlsberg :Ham :SweetPepper ) ) . tabOTTR: #OTTR prefix ottr http://ns.ottr.xyz/templates# #OTTR template Name Country Toppings 1 2 3 iri iri iri+ :Marghertia :Italy :Tomato | :Mozzerella :Grandiosa :Tomato | :Jarlsberg | :Ham | :SweetPepper
  23. 23. 10/25 Internal model Our internal model represents a set of templates (library) as a graph, where nodes are template heads (name and parameters), and edges are instances (arguments and modes).
  24. 24. 10/25 Internal model Our internal model represents a set of templates (library) as a graph, where nodes are template heads (name and parameters), and edges are instances (arguments and modes). For example: OBJECTSOMEVALUESFROM(?x, ?p, ?r) :: TRIPLE(?x, rdf:type, owl:Restriction), TRIPLE(?x, owl:onProperty, ?p), TRIPLE(?x, owl:someValuesFrom, ?r) . SUBCLASSOF(?s, ?c) :: TRIPLE(?s, rdfs:subClassOf, ?c) . SUBOBJECTSOMEVALUESFROM(?x, ?p, ?r) :: SUBCLASSOF(?x, _:b1), OBJECTSOMEVALUESFROM(_:b1, ?p, ?r) .
  25. 25. 10/25 Internal model Our internal model represents a set of templates (library) as a graph, where nodes are template heads (name and parameters), and edges are instances (arguments and modes). For example: OBJECTSOMEVALUESFROM(?x, ?p, ?r) :: TRIPLE(?x, rdf:type, owl:Restriction), TRIPLE(?x, owl:onProperty, ?p), TRIPLE(?x, owl:someValuesFrom, ?r) . SUBCLASSOF(?s, ?c) :: TRIPLE(?s, rdfs:subClassOf, ?c) . SUBOBJECTSOMEVALUESFROM(?x, ?p, ?r) :: SUBCLASSOF(?x, _:b1), OBJECTSOMEVALUESFROM(_:b1, ?p, ?r) . ⇒
  26. 26. 10/25 Internal model Our internal model represents a set of templates (library) as a graph, where nodes are template heads (name and parameters), and edges are instances (arguments and modes). For example: OBJECTSOMEVALUESFROM(?x, ?p, ?r) :: TRIPLE(?x, rdf:type, owl:Restriction), TRIPLE(?x, owl:onProperty, ?p), TRIPLE(?x, owl:someValuesFrom, ?r) . SUBCLASSOF(?s, ?c) :: TRIPLE(?s, rdfs:subClassOf, ?c) . SUBOBJECTSOMEVALUESFROM(?x, ?p, ?r) :: SUBCLASSOF(?x, _:b1), OBJECTSOMEVALUESFROM(_:b1, ?p, ?r) . ⇒ SUBOBJECTSOMEVALUESFROM(?x, ?p, ?r) SUBCLASSOF(?s, ?c) OBJECTSOMEVALUESFROM(?X, ?P, ?R) TRIPLE(?s, ?p, ?o) (?x, _:b1) (_:b1, ?p, ?r) (?s, rdfs:subClassOf, ?c) (?x, rdf:type, owl:Restriction) (?x, owl:onProperty, ?p) (?x, owl:someValuesFrom, ?r)
  27. 27. 10/25 Internal model Our internal model represents a set of templates (library) as a graph, where nodes are template heads (name and parameters), and edges are instances (arguments and modes). For example: OBJECTSOMEVALUESFROM(?x, ?p, ?r) :: TRIPLE(?x, rdf:type, owl:Restriction), TRIPLE(?x, owl:onProperty, ?p), TRIPLE(?x, owl:someValuesFrom, ?r) . SUBCLASSOF(?s, ?c) :: TRIPLE(?s, rdfs:subClassOf, ?c) . SUBOBJECTSOMEVALUESFROM(?x, ?p, ?r) :: SUBCLASSOF(?x, _:b1), OBJECTSOMEVALUESFROM(_:b1, ?p, ?r) . SUBCLASSOF(:Margherita, :NamedPizza) . SUBOBJECTSOMEVALUESFROM(:Margherita, :hasTopping, :Cheese) . ⇒ SUBOBJECTSOMEVALUESFROM(?x, ?p, ?r) SUBCLASSOF(?s, ?c) OBJECTSOMEVALUESFROM(?X, ?P, ?R) TRIPLE(?s, ?p, ?o) (?x, _:b1) (_:b1, ?p, ?r) (?s, rdfs:subClassOf, ?c) (?x, rdf:type, owl:Restriction) (?x, owl:onProperty, ?p) (?x, owl:someValuesFrom, ?r) (:Margherita, :hasTopping, :Cheese)(:Margherita, :NamedPizza)
  28. 28. 11/25 Different Basis The underlying language (e.g. RDF, OWL, etc.) depends only on leaf-nodes in graph. Thus, can easily substitute TRIPLE as leaves with SUBCLASSOF, SUBOBJECTSOMEVALUESFROM, etc. to form an OWL-basis, QUAD, to form a basis with named RDF graphs, ... Only Readers and Writers that treats base templates differently. Thus, only need to write new Readers and Writers to implement new base.
  29. 29. 12/25 Lifting and lowering head T (p1, . . ., pn) :: body O lifting lowering
  30. 30. 13/25 Templates as data transformation Instances Lifting Template definitions Ontology Lowering Templates as Queries Instances
  31. 31. 14/25 Redundancy DRY (Don’t repeat yourself) is an imporant principle in software engineering: ”Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.“
  32. 32. 14/25 Redundancy DRY (Don’t repeat yourself) is an imporant principle in software engineering: ”Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.“ Redundancy makes maintaining a system cumbersome.
  33. 33. 14/25 Redundancy DRY (Don’t repeat yourself) is an imporant principle in software engineering: ”Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.“ Redundancy makes maintaining a system cumbersome. Redundancy fixed by capturing patterns in abstractions (method, class, etc.) and refactoring.
  34. 34. 15/25 Redundancy in templates In our case, redundancy is sets of instances repeated over several template definitions.
  35. 35. 15/25 Redundancy in templates In our case, redundancy is sets of instances repeated over several template definitions. NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b2), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), OBJECTUNIONOF(_:b2, ?Condiments), x | (?Name, rdfs:label, ?Label) .
  36. 36. 15/25 Redundancy in templates In our case, redundancy is sets of instances repeated over several template definitions. NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b2), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), OBJECTUNIONOF(_:b2, ?Condiments), x | (?Name, rdfs:label, ?Label) .
  37. 37. 15/25 Redundancy in templates In our case, redundancy is sets of instances repeated over several template definitions. Simple structure of OTTR (seen as dependency graph) makes analysis possible. NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b2), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), OBJECTUNIONOF(_:b2, ?Condiments), x | (?Name, rdfs:label, ?Label) .
  38. 38. 16/25 Types of redundancy We distinguish between two types of redundancy: Lack of reuse: Pattern already captured by definition, refactor. Uncaptured pattern: Pattern not captured by definition, define new template.
  39. 39. 17/25 Dependency pairs A dependency pair is a pair: Pattern: multiset of templates I, Use of pattern: a set of template T.
  40. 40. 17/25 Dependency pairs A dependency pair is a pair: Pattern: multiset of templates I, Use of pattern: a set of template T. Treat TRIPLE(:a, :r, :b) as :r(:a, :b) to also capture patterns of properties. E.g.
  41. 41. 17/25 Dependency pairs A dependency pair is a pair: Pattern: multiset of templates I, Use of pattern: a set of template T. Treat TRIPLE(:a, :r, :b) as :r(:a, :b) to also capture patterns of properties. E.g. I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM} T = {BURGER, NAMEDPIZZA}
  42. 42. 17/25 Dependency pairs A dependency pair is a pair: Pattern: multiset of templates I, Use of pattern: a set of template T. Treat TRIPLE(:a, :r, :b) as :r(:a, :b) to also capture patterns of properties. E.g. I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM} T = {BURGER, NAMEDPIZZA} Intuitively, a dependency pair captures a potential redundancy.
  43. 43. 18/25 Candidates Only look at dependency pairs where both |T | and |I| are ≥ 2.
  44. 44. 18/25 Candidates Only look at dependency pairs where both |T | and |I| are ≥ 2. We call these candidates.
  45. 45. 18/25 Candidates Only look at dependency pairs where both |T | and |I| are ≥ 2. We call these candidates. For a candidate, we have one of three cases: Not a pattern (use of instances does not unify) A lack of reuse (pattern is already equal to body of existing template) An uncaptured pattern
  46. 46. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBCLASSOF(?Name, _:b2), OBJECTALLVALUESFROM(_:b2, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) .
  47. 47. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBCLASSOF(?Name, _:b2), OBJECTALLVALUESFROM(_:b2, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, OBJECTALLVALUESFROM } T = {BURGER, SUBOBJECTALLVALUESFROM }
  48. 48. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBCLASSOF(?Name, _:b2), OBJECTALLVALUESFROM(_:b2, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, OBJECTALLVALUESFROM } T = {BURGER, SUBOBJECTALLVALUESFROM } I-instances of SUBOBJECTALLVALUESFROM equals its body.
  49. 49. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBCLASSOF(?Name, _:b2), OBJECTALLVALUESFROM(_:b2, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, OBJECTALLVALUESFROM } T = {BURGER, SUBOBJECTALLVALUESFROM } I-instances of SUBOBJECTALLVALUESFROM equals its body. Check for lack of reuse in BURGER.
  50. 50. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBCLASSOF(?Name, _:b2), OBJECTALLVALUESFROM(_:b2, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, OBJECTALLVALUESFROM } T = {BURGER, SUBOBJECTALLVALUESFROM } I-instances of SUBOBJECTALLVALUESFROM equals its body. Check for lack of reuse in BURGER. I-instances of BURGER equals SUBOBJECTALLVALUESFROM’s body.
  51. 51. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBCLASSOF(?Name, _:b2), OBJECTALLVALUESFROM(_:b2, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, OBJECTALLVALUESFROM } T = {BURGER, SUBOBJECTALLVALUESFROM } I-instances of SUBOBJECTALLVALUESFROM equals its body. Check for lack of reuse in BURGER. I-instances of BURGER equals SUBOBJECTALLVALUESFROM’s body. Refactor!
  52. 52. 19/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3)), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, OBJECTALLVALUESFROM } T = {BURGER, SUBOBJECTALLVALUESFROM } I-instances of SUBOBJECTALLVALUESFROM equals its body. Check for lack of reuse in BURGER. I-instances of BURGER equals SUBOBJECTALLVALUESFROM’s body. Refactor!
  53. 53. 20/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) .
  54. 54. 20/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM, OBJECTUNIONOF, SUBOBJECTSOMEVALUESFROM } T = {BURGER, NAMEDPIZZA }
  55. 55. 20/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM, OBJECTUNIONOF, SUBOBJECTSOMEVALUESFROM } T = {BURGER, NAMEDPIZZA } No lack of reuse – make new template:
  56. 56. 20/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM, OBJECTUNIONOF, SUBOBJECTSOMEVALUESFROM } T = {BURGER, NAMEDPIZZA } No lack of reuse – make new template: <NAME>(?x1, ?x2, ?x3, ?x4) :: SUBCLASSOF(?x1, ?x2), SUBOBJECTALLVALUESFROM(?x1, ?x3, _:c1), OBJECTUNIONOF(_:c1, ?x4), x | SUBOBJECTSOMEVALUESFROM(?x1, ?x3, ?x4) .
  57. 57. 20/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM, OBJECTUNIONOF, SUBOBJECTSOMEVALUESFROM } T = {BURGER, NAMEDPIZZA } No lack of reuse – make new template: FOOD(?x1, ?x2, ?x3, ?x4) :: SUBCLASSOF(?x1, ?x2), SUBOBJECTALLVALUESFROM(?x1, ?x3, _:c1), OBJECTUNIONOF(_:c1, ?x4), x | SUBOBJECTSOMEVALUESFROM(?x1, ?x3, ?x4) .
  58. 58. 20/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: SUBCLASSOF(?Name, :NamedPizza), SUBOBJECTALLVALUESFROM(?Name, :hasTopping, _:b1), OBJECTUNIONOF(_:b1, ?Toppings), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: SUBCLASSOF(?Name, :Burger), SUBOBJECTALLVALUESFROM(?Name, :hasCondiment, _:b3), OBJECTUNIONOF(_:b3, ?Condiments), x | SUBOBJECTSOMEVALUESFROM(?Name, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . I = {SUBCLASSOF, SUBOBJECTALLVALUESFROM, OBJECTUNIONOF, SUBOBJECTSOMEVALUESFROM } T = {BURGER, NAMEDPIZZA } No lack of reuse – make new template: FOOD(?Name : 1 class, ?Category : 1 class, ?hasPart : 1 property, ?Parts : + class) :: SUBCLASSOF(?Name, ?Category), SUBOBJECTALLVALUESFROM(?Name, ?hasPart, _:c1), OBJECTUNIONOF(_:c1, ?Parts), x | SUBOBJECTSOMEVALUESFROM(?Name, ?hasPart, ?Parts) .
  59. 59. 21/25 Using candidates NAMEDPIZZA(?Name : 1 class, ?Country : ? individual, ?Toppings : + class) :: FOOD(?Name, :NamedPizza, :hasTopping, ?Toppings), SUBOBJECTHASVALUE(?Name, :hasCountry, ?Country) . BURGER(?Name : 1 class, ?Condiments : + class, ?Label : + literal) :: FOOD(?Name, :Burger, :hasCondiment, ?Condiments), x | TRIPLE(?Name, rdfs:label, ?Label) . SUBOBJECTALLVALUESFROM(?c : 1 class, ?p : 1 objectProperty, ?r : 1 class) :: SUBCLASSOF(?c, _:b4), OBJECTALLVALUESFROM(_:b4, ?p, ?r) . FOOD(?Name : 1 class, ?Category : 1 class, ?hasPart : 1 property, ?Parts : + class) :: SUBCLASSOF(?Name, ?Category), SUBOBJECTALLVALUESFROM(?Name, ?hasPart, _:c1), OBJECTUNIONOF(_:c1, ?Parts), x | SUBOBJECTSOMEVALUESFROM(?Name, ?hasPart, ?Parts) .
  60. 60. 22/25 Aibel use-case
  61. 61. 23/25 Plot of candidates 0 5 10 15 20 25 30 1 10 100 #Instances #Templates 'counts.data' u 1:2:3 1 10 100 1000 10000 100000 1x106 Figure: A scatter plot of the sizes of the two sets for all candidate pairs from Aibel use case.
  62. 62. 24/25 Use of candidates Choose an important template describing elbow pipes (ASME B16.9).
  63. 63. 24/25 Use of candidates Choose an important template describing elbow pipes (ASME B16.9). This occurs in over 12,000 candidates.
  64. 64. 24/25 Use of candidates Choose an important template describing elbow pipes (ASME B16.9). This occurs in over 12,000 candidates. By removing candidates that
  65. 65. 24/25 Use of candidates Choose an important template describing elbow pipes (ASME B16.9). This occurs in over 12,000 candidates. By removing candidates that contains non-domain specific instances (rdfs:label, skos:comment, etc.); and contains few (less than 7) instances or templates, got down to 24 candidates.
  66. 66. 24/25 Use of candidates Choose an important template describing elbow pipes (ASME B16.9). This occurs in over 12,000 candidates. By removing candidates that contains non-domain specific instances (rdfs:label, skos:comment, etc.); and contains few (less than 7) instances or templates, got down to 24 candidates. Two of theese (containing 7 instances) were repeated very often (≥ 30 templates).
  67. 67. 24/25 Use of candidates Choose an important template describing elbow pipes (ASME B16.9). This occurs in over 12,000 candidates. By removing candidates that contains non-domain specific instances (rdfs:label, skos:comment, etc.); and contains few (less than 7) instances or templates, got down to 24 candidates. Two of theese (containing 7 instances) were repeated very often (≥ 30 templates). Using the process above, we got this template, which we could use in all the templates: <NAME>(?x1, ?x2, ?x3, ?x4, ?x5, ?x6, ?x7, ?x8) :: HASREVISIONPREMISE(?x1, ?x2), SHORTDESCRIPTION-GEOMETRY(?x1, ?x3), ISDEFINEDASCOMMODITYCLASSINSPEC(?x1, ?x5), HASGEOMETRICALPATTERN(?x1, ?x8), ISDEFINEDININDUSTRYSTANDARD(?x1, ?x4), LONGDESCRIPTION-GEOMETRY(?x1, ?x6), CADDESCRIPTION-GEOMETRY(?x1, ?x7) .
  68. 68. 25/25 The End Thank you for listening!

×