diff --git a/index.ts b/index.ts index af95bc2..a9d93b0 100644 --- a/index.ts +++ b/index.ts @@ -22,6 +22,7 @@ export const LDP: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, ` export const POSIXSTAT: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `posix_stat.ttl`)); export const SCHEMA: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `schema.ttl`)); export const SHACL: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `shacl.ttl`)); +export const SHAPETREE: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `shapetree.ttl`)); export const SKOS: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `skos.ttl`)); export const SKOSXL: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `skos-xl.ttl`)); export const SOLIDTERMS: NodeJS.ReadableStream = createReadStream(joinPath(__dirname, `solid_terms.ttl`)); diff --git a/package.json b/package.json index eac24d8..c6db5a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ontl", - "version": "0.1.5", + "version": "0.1.6", "description": "A collection of ontologies serialised in turtle, readable as stream.", "main": "index.js", "scripts": { diff --git a/shapetree.ttl b/shapetree.ttl new file mode 100644 index 0000000..b04af74 --- /dev/null +++ b/shapetree.ttl @@ -0,0 +1,334 @@ +# See details within this document for linkage to specification and purpose. +# This ontology file is a non-normative supporting document. + +# Shape tree ontology + +## Ontology preferred namespace prefix and URI +prefix shapetree: + +## Other namespaces used +### Core W3C ontologies (OWL 2 reserved vocabulary) +prefix rdf: +prefix rdfs: +prefix owl: +prefix xsd: +### Other ontologies +prefix dcterms: +prefix vann: + +## Ontology + + a owl:Ontology ; + rdfs:label "Shape tree ontology"@en ; + rdfs:isDefinedBy ; + rdfs:seeAlso + ; + dcterms:issued "2020-07-01"^^xsd:date ; + dcterms:modified "2020-07-06"^^xsd:date ; + vann:preferredNamespacePrefix "shapetree" ; + vann:preferredNamespaceUri "http://www.w3.org/ns/shapetree#"^^xsd:anyURI . + + +# ShapeTree Class +############################################################################# +# Defines a tree of related resources which combine to enable some task +# see: https://shapetrees.github.io/specification/primer +############################################################################# +shapetree:ShapeTree + a rdfs:Class ; + rdfs:comment "Defines a composite data structure including a tree of resources and validation criteria"@en ; + rdfs:isDefinedBy ; + rdfs:label "Shape Tree"@en . + +# +# Properties in domain of ShapeTree +# +shapetree:expectsType + a owl:ObjectProperty ; + rdfs:domain :ShapeTree ; + rdfs:range [ owl:oneOf ( :ShapeTreeContainer :ShapeTreeResource ) ] ; + rdfs:comment "Describes the expected type of resource the ShapeTree will validate against."@en ; + rdfs:isDefinedBy ; + rdfs:label "Expects Type"@en . + +shapetree:contains + a owl:ObjectProperty ; + rdfs:domain :ShapeTree ; + rdfs:range :ShapeTree ; + rdfs:comment "Links a ShapeTree to another ShapeTree that is directly contained within its planted ShapeTreeContainer"@en ; + rdfs:isDefinedBy ; + rdfs:label "Contains"@en . + +shapetree:references + a owl:ObjectProperty ; + rdfs:domain :ShapeTree ; + rdfs:range :ShapeTreeReference ; + rdfs:isDefinedBy ; + rdfs:comment "Links a ShapeTree to a ShapeTreeReference"@en ; + rdfs:label "References"@en . + +shapetree:matchesUriTemplate + a owl:DatatypeProperty ; + rdfs:domain :ShapeTree ; + rdfs:range xsd:string ; + rdfs:comment "Describes a URI Template (RFC 6570) that governs the naming of resources of this Shape Tree"@en ; + rdfs:isDefinedBy ; + rdfs:label "Matches URI Template"@en . + +shapetree:validatedBy + a owl:ObjectProperty ; + rdfs:domain :ShapeTree ; + rdfs:comment "Links a ShapeTree to a Shape"@en ; + rdfs:isDefinedBy ; + rdfs:label "Validated By"@en . + +shapetree:supports + a owl:ObjectProperty ; + rdfs:domain :ShapeTree ; + rdfs:range :ShapeTree ; + rdfs:comment "Describes a relationship wherein a ShapeTree acts as a support for another, for purposes of indexing, aggregation, etc." ; + rdfs:isDefinedBy ; + rdfs:label "Supports"@en . + +# +# Specific IRIs used by :contains predicate to define behavior +# when a matching ShapeTree with a URI Template is not found. +# These values can be combined, for example, +# :contains :AllowResources :AllowContainers :AllowNonRDFSources is equivalent to :AllowAll +# Example -- <#containerShapeTree> st:contains <#childShapeTree>, st:AllowResources +# +shapetree:AllowResources + a :ShapeTree ; + rdfs:comment "If no matching :contains ShapeTree is found, allow if the requested content is a :ShapeTreeResource"@en ; + rdfs:isDefinedBy ; + rdfs:label "Allow Resources"@en . + +shapetree:AllowContainers + a :ShapeTree ; + rdfs:comment "If no matching :contains ShapeTree is found, allow if the requested content is a :ShapeTreeContainer"@en ; + rdfs:isDefinedBy ; + rdfs:label "Allow Containers"@en . + +shapetree:AllowNonRDFSources + a :ShapeTree ; + rdfs:comment "If no matching :contains ShapeTree is found, only allow if the requested content is a :ShapeTreeNonRDFResource"@en ; + rdfs:isDefinedBy ; + rdfs:label "Allow NonRDFSources"@en . + +shapetree:AllowAll + a :ShapeTree ; + rdfs:comment "If no matching :contains ShapeTree is found, allow all types of unexpected content"@en ; + rdfs:isDefinedBy ; + rdfs:label "Allow All"@en . + +shapetree:AllowNone + a :ShapeTree ; + rdfs:comment "If no matching :contains ShapeTree is found, do not allow any content"@en ; + rdfs:isDefinedBy ; + rdfs:label "Allow None"@en . + +# ShapeTreeContainer IRI (maps to ldp:Container) +############################################################################# +# An IRI that represents a generalized container used in a ShapeTree +############################################################################# +shapetree:ShapeTreeContainer + rdfs:comment "Describes a generalized container within a ShapeTree ecosystem"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeContainer"@en . + + +# ShapeTreeResource IRI (maps to ldp:Resource) +############################################################################# +# An IRI that represents a generalized resource used in a ShapeTree +############################################################################# +shapetree:ShapeTreeResource + rdfs:comment "Describes a generalized RDF resource (non-container) within a ShapeTree ecosystem"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeResource"@en . + +# ShapeTreeNonRDFResource IRI (maps to ldp:NonRDFSource) +############################################################################# +# An IRI that represents a generalized resource used in a ShapeTree +############################################################################# +shapetree:ShapeTreeNonRDFResource + rdfs:comment "Describes a generalized non RDF / binary content within a ShapeTree ecosystem"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeResource"@en . + + +# ShapeTreeReference class +############################################################################# +# A ShapeTreeReference provides the necessary context to associate instance +# data between related ShapeTrees via a ShapePath +############################################################################# +shapetree:ShapeTreeReference + a rdfs:Class ; + rdfs:comment "Describes how a ShapeTree references another ShapeTree via a ShapePath"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeReference"@en . + +# +# Properties in domain of ShapeTreeReference +# +shapetree:traverseViaShapePath + a owl:DatatypeProperty ; + rdfs:domain :ShapeTreeReference ; + rdfs:range xsd:string ; + rdfs:comment "Describes how one ShapeTree traverses its instance data to reach another ShapeTree"@en ; + rdfs:isDefinedBy ; + rdfs:label "Traverse Via ShapePath"@en . + + +# +# Properties in range of ShapeTreeDecoratorIndex +# +shapetree:hasShapeTreeDecoratorIndex + a owl:ObjectProperty ; + rdfs:range :ShapeTreeDecoratorIndex ; + rdfs:isDefinedBy ; + rdfs:label "Has ShapeTree Decorator Index"@en . + +# ShapeTreeDecoratorIndex class +############################################################################# +# A ShapeTreeDecoratorIndex details a ShapeTree in a human-readable way. +# It is primarily used for use cases where a ShapeTree must be described to +# a user for purposes of authorization. +############################################################################# +shapetree:ShapeTreeDecoratorIndex + a rdfs:Class ; + rdfs:comment "Provides an index of SKOS poly-hierarchies which can be used to describe a ShapeTree"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeDecoratorIndex"@en . + +# Properties in domain of ShapeTreeDecoratorIndex +######################################################### +shapetree:hasSeries + a owl:ObjectProperty ; + rdfs:domain :ShapeTreeDecoratorIndex ; + rdfs:range :ShapeTreeDecoratorSeries ; + rdfs:comment "Links between a ShapeTreeDecoratorIndex and a ShapeTreeDecoratorSeries"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has Series"@en . + +# ShapeTreeDecoratorSeries class +############################################################################# +# A ShapeTreeDecoratorSeries details a versioned set of ShapeTreeDecoratorHierarchy classes +# Primary use is grouping TreeDecoratorHierarchy instances by a common discriminator +# such as language or intended audience +############################################################################# +shapetree:ShapeTreeDecoratorSeries + a rdfs:Class ; + rdfs:comment "Groups a set of ShapeTreeDecoratorHierarchy by a given discriminator"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeDecoratorSeries"@en . + +# +# Properties in domain of ShapeTreeDecoratorSeries +# +shapetree:hasHierarchy + a owl:ObjectProperty ; + rdfs:domain :ShapeTreeDecoratorSeries ; + rdfs:range :ShapeTreeDecoratorHierarchy ; + rdfs:comment "Links between a ShapeTreeDecoratorSeries and a ShapeTreeDecoratorHierarchy"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has Hierarchy"@en . + +# ShapeTreeDecoratorHierarchy class +############################################################################# +# A ShapeTreeDecoratorHierarchy details a versioned SKOS poly-hierarchy that describes +# a ShapeTree in a given language or format for an intended audience +# (decreased cognitivty ability, etc.) +############################################################################# +shapetree:ShapeTreeDecoratorHierarchy + a rdfs:Class ; + rdfs:comment "Describes a SKOS poly-hierarchy for purproses of labeling a ShapeTree"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeDecoratorHierarchy"@en . + +# Properties in domain of ShapeTreeDecoratorHierarchy +######################################################### +shapetree:hasVersion + a owl:DatatypeProperty ; + rdfs:domain :ShapeTreeDecoratorHierarchy ; + rdfs:range xsd:string ; + rdfs:comment "Describes the version of a ShapeTreeDecoratorHierarchy"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has Version"@en . + +shapetree:hasSHA256Hash + a owl:DatatypeProperty ; + rdfs:domain :ShapeTreeDecoratorHierarchy ; + rdfs:range xsd:string ; + rdfs:comment "Describes the SHA-256 of a ShapeTreeDecoratorHierarchy"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has SHA-256 Hash"@en . + +shapetree:hasSkosGraph + a owl:ObjectProperty ; + rdfs:domain :ShapeTreeDecoratorHierarchy ; + rdfs:range :ShapeTreeLabel ; + rdfs:comment "Represents the IRI to the SKOS graph described by ShapeTreeDecoratorHierarchy instance"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has SKOS Graph"@en . + +# ShapeTreeLabel class +############################################################################# +# A ShapeTreeLabel details the association between a label within a SKOS graph +# (detailed by ShapeTreeDecoratorHierarchy) and a ShapeTree +############################################################################# +shapetree:ShapeTreeLabel + a rdfs:Class ; + rdfs:comment "Describes the association between a SKOS label and a ShapeTree"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeLabel"@en . + + +# Properties in the range of ShapeTreeLocator +######################################################### +shapetree:hasShapeTreeLocator + a owl:ObjectProperty ; + rdfs:range :ShapeTreeLocator ; + rdfs:comment "Represents the association between a subject an one or more ShapeTreeLocator"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has ShapeTree Locator"@en . + + +# ShapeTreeLocator class +############################################################################# +# A ShapeTreeLocator describes a planted ShapeTree in a container with enough +# information to traverse from the current container to the root +############################################################################# +shapetree:ShapeTreeLocator + a rdfs:Class ; + rdfs:comment "Describes a planted ShapeTree in a container with enough information to traverse from the current container to the root"@en ; + rdfs:isDefinedBy ; + rdfs:label "ShapeTreeLocator"@en . + +# Properties in domain of ShapeTreeLocator +######################################################### + +shapetree:hasShapeTreeInstanceRoot + a owl:ObjectProperty ; + rdfs:domain :ShapeTreeLocator ; + rdfs:comment "Represents the IRI of a root of a planted ShapeTree hierarchy"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has ShapeTree Instance Root"@en . + +shapetree:hasRootShapeTree + a owl:ObjectProperty ; + rdfs:domain :ShapeTreeLocator ; + rdfs:range :ShapeTree ; + rdfs:comment "Represents the ShapeTree that is planted at the root of the ShapeTree hierarchy. For flat structures, hasRootShapeTree and hasShapeTree will be the same."@en ; + rdfs:isDefinedBy ; + rdfs:label "Has Root ShapeTree"@en . + + +################################################################ +# A generalized predicate for linking a class to a ShapeTree +################################################################ +shapetree:hasShapeTree + a owl:ObjectProperty ; + rdfs:range :ShapeTree ; + rdfs:comment "Represents the IRI of a ShapeTree that is referenced by some subject"@en ; + rdfs:isDefinedBy ; + rdfs:label "Has ShapeTree Instance Root"@en .