11
LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Embed Size (px)

Citation preview

Page 1: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

LDOM (Linked Data Object Model)

Motivation & Overview for Shapes WG

Holger Knublauch2015-01-22

Page 2: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Motivation

• LDOM is the result of discussions in Shapes WG and the previous mailing list

• Attempts to cover the essential features of the input languages SPIN & Resource Shapes/ShEx

• Evolutionary compatibility with RDFS/OWL• Covers all requirements in our current catalogue

• Goal: A starting point to work out details• Feedback so far has been very positive

Page 3: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Naming

• Finding the perfect name is difficult• A name also signals community outreach• Messages– “Linked Data”– “Schema/Specification/Shape Language”– “Web Objects” or “OO for the Web”– “Schema language for JSON-LD”

• LDOS (Linked Data Object Shapes) would be OK

Page 4: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Example

schema:Personex:Rectanglewidth: integer[1..1]height: integer[1..1]area: integer[0..1]

ex:Square

ex:creator0..1 0..*

width and height must be > 0

area :=width x height

width and height must be equal

Page 5: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Class Definitions

• Just like in RDF Schema or OWL• People can reuse/extend existing ontologies• Only relies on a small subset of RDFS:

(rdf:type, rdfs:Class, rdfs:subClassOf)

ex:Rectangle a rdfs:Class ; rdfs:subClassOf rdfs:Resource ; rdfs:label "Rectangle" .

ex:Square a rdfs:Class ; rdfs:subClassOf ex:Rectangle ; rdfs:label "Square" .

Page 6: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Property Declarations

• Similar to object-oriented attributes/relationsex:Rectangle a rdfs:Class ; rdfs:subClassOf rdfs:Resource ; rdfs:label "Rectangle" ; ldom:property [ a ldom:PropertyConstraint ; # Optional ldom:predicate ex:height ; ldom:minCount 1 ; ldom:maxCount 1 ; ldom:valueType xsd:integer ; rdfs:label "height" ; rdfs:comment "The height of the Rectangle." ; ] ; ...

Page 7: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Possible JSON-LD Syntax{ "@id" : "ex:Rectangle", "@type" : "Class", "subClassOf" : "rdfs:Resource", "label" : "Rectangle", "property" : [ { "predicate" : "ex:height", "minCount" : 1, "maxCount" : 1, "valueType" : "xsd:integer", "label" : "height", "comment" : "The height of the Rectangle." }, ... ]}

Page 8: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

SPARQL Constraintsex:Square a rdfs:Class ; rdfs:label "Square" ; rdfs:subClassOf ex:Rectangle ; ldom:constraint [ ldom:message "Width and height of a Square must be equal" ; ldom:path ex:width ; ldom:path ex:height ; ldom:sparql """ ASK { ?this ex:width ?width . ?this ex:height ?height . FILTER (?width != ?height) . } """ ; ] .

Page 9: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Templates and Functions

• Encapsulate reusable SPARQL logic• Define simpler, high-level languages• LDOM itself uses templates

(e.g. ldom:minCount is based on SPARQL)• Side-effect: Language is self-contained• Language is extensible (based on Linked Data)

Page 10: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Template-Based Constraintsex:Rectangle # Each Rectangle must have a creator that has # an email address ldom:constraint [ a ldom:ShapeConstraint ; ldom:predicate ex:creator ; ldom:some [ ldom:property [ ldom:predicate schema:email ; ldom:minCount 1 ; ] ; ] ; ] ;

Recursive shapes like in Resource Shapes / ShEx

Page 11: LDOM (Linked Data Object Model) Motivation & Overview for Shapes WG Holger Knublauch 2015-01-22

Other Features

• Datatype constraint declarations• Default values, enumerations• Inverse and derived properties• Static (global) constraints• Graph management (includes etc)• Built-in SPARQL functions• Test Case vocabulary• Rules (perhaps a separate deliverable)