Skip to content

Commit

Permalink
enhanced documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
s-tittel committed Oct 19, 2023
1 parent c345c2b commit 60dd162
Show file tree
Hide file tree
Showing 15 changed files with 513 additions and 210 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data-shape-subject | Optional subject (id) of the SHACL node shape to use as roo
data-values | RDF triples (e.g. a turtle string) to use as existing data values to fill the form
data-values-url | When `data-values` is not set, the data triples are loaded from this URL
data-value-subject | The subject (id) of the generated data. If this is not set, a blank node with a new UUID will be used. If `data-values` or `data-values-url` is set, this id is also used to find existing data in the data graph to fill the form
data-language | Language to use if shapes contain langStrings, e.g. in `sh:name` or `rdfs:label`
data-language | Language to use if shapes contain langStrings, e.g. in `sh:name` or `rdfs:label`. Default is [`navigator.language`](https://www.w3schools.com/jsref/prop_nav_language.asp)
data‑ignore‑owl‑imports | By default, `owl:imports` IRIs are fetched and the resulting triples added to the shapes graph. Set this attribute to any value in order to disable this feature
data-submit-button | Whether to add a submit button to the form. The value of this attribute is used as the button label. `submit` events will only fire after successful validation
Expand Down
42 changes: 21 additions & 21 deletions demo/complex-example-data.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
@prefix prov: <http://www.w3.org/ns/prov#> .

example:4f2a8de3-9fc8-40a9-9237-d5964520ec54
a dcat:Dataset, example:ArchitectureModelDataset ;
dcterms:title "Einsteinturm"@de, "Einstein Tower"@en ;
dcterms:description "Modell des Einsteinturms"@de, "Model of the Einstein Tower"@en ;
dcterms:issued "2023-07-27"^^xsd:date ;
dcterms:license <http://creativecommons.org/licenses/by/4.0/> ;
schema:artworkSurface example:wood ;
schema:width 200 ;
dcterms:spatial [
a dcterms:Location ;
geo:asWKT "POLYGON((13.06382134836241 52.37900504575066,13.063796707503286 52.37896794299019,13.063798350228126 52.37875635638159,13.063926482692182 52.37875435081642,13.0639281254158 52.378964934657034,13.063905127281544 52.37900404297392,13.06382134836241 52.37900504575066))"^^geo:wktLiteral ;
dcterms:description "Building has been realized here" ;
] ;
prov:qualifiedAttribution [
a prov:Attribution ;
prov:agent [
a foaf:Person ;
foaf:name "Jane Doe";
dcterms:identifier "https://orcid.org/0000-0002-1584-4316" ;
] ;
dcat:hadRole <http://w3id.org/nfdi4ing/metadata4ing#DataCollector> ;
] .
a dcat:Dataset, example:ArchitectureModelDataset ;
dcterms:title "Einsteinturm"@de, "Einstein Tower"@en ;
dcterms:description "Modell des Einsteinturms"@de, "Model of the Einstein Tower"@en ;
dcterms:issued "2023-07-27"^^xsd:date ;
dcterms:license <http://creativecommons.org/licenses/by/4.0/> ;
schema:artworkSurface example:plaster ;
schema:width 200 ;
dcterms:spatial [
a dcterms:Location ;
geo:asWKT "POLYGON((13.06382134836241 52.37900504575066,13.063796707503286 52.37896794299019,13.063798350228126 52.37875635638159,13.063926482692182 52.37875435081642,13.0639281254158 52.378964934657034,13.063905127281544 52.37900404297392,13.06382134836241 52.37900504575066))"^^geo:wktLiteral ;
dcterms:description "Building has been realized here" ;
] ;
prov:qualifiedAttribution [
a prov:Attribution ;
prov:agent [
a foaf:Person ;
foaf:name "Jane Doe";
dcterms:identifier "https://orcid.org/0000-0002-1584-4316" ;
] ;
dcat:hadRole <http://w3id.org/nfdi4ing/metadata4ing#DataCollector> ;
] .
297 changes: 151 additions & 146 deletions demo/complex-example.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -14,166 +14,171 @@
@prefix example: <http://example.org/> .

example:ArchitectureModelDataset
a sh:NodeShape ;
sh:node example:Dataset ;
a sh:NodeShape ;
sh:node example:Dataset ;

sh:property [ sh:description "Location of the building" ;
sh:name "Location" ;
sh:node example:Location ;
sh:path dcterms:spatial
] ;
sh:property [ sh:datatype xsd:integer ;
sh:description "Width [mm] of the model" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:minInclusive 1 ;
sh:name "Width" ;
sh:path schema:width
] ;
sh:property [ sh:datatype xsd:integer ;
sh:description "Height [mm] of the model" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:minInclusive 1 ;
sh:name "Height" ;
sh:path schema:height
] ;
sh:property [ sh:datatype xsd:integer ;
sh:description "Depth [mm] of the model" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:minInclusive 1 ;
sh:name "Depth" ;
sh:path schema:depth
] ;
sh:property [ sh:datatype xsd:string ;
sh:description "Scale of the model, e.g. 1:20" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:name "Scale" ;
sh:path dbpedia:scale ;
sh:pattern "^\\d+:\\d+$"
] ;
sh:property [ sh:description "Material used with this model"@en , "Beim Bau des Modells verwendetes Material"@de ;
sh:group example:PhysicalPropertiesGroup ;
sh:name "Artwork material" ;
sh:path schema:artworkSurface ;
sh:class example:Material ;
] .
sh:property [ sh:description "Location of the building" ;
sh:name "Location" ;
sh:node example:Location ;
sh:path dcterms:spatial
] ;
sh:property [ sh:datatype xsd:integer ;
sh:description "Width [mm] of the model" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:minInclusive 1 ;
sh:name "Width" ;
sh:path schema:width
] ;
sh:property [ sh:datatype xsd:integer ;
sh:description "Height [mm] of the model" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:minInclusive 1 ;
sh:name "Height" ;
sh:path schema:height
] ;
sh:property [ sh:datatype xsd:integer ;
sh:description "Depth [mm] of the model" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:minInclusive 1 ;
sh:name "Depth" ;
sh:path schema:depth
] ;
sh:property [ sh:datatype xsd:string ;
sh:description "Scale of the model, e.g. 1:20" ;
sh:group example:PhysicalPropertiesGroup ;
sh:maxCount 1 ;
sh:name "Scale" ;
sh:path dbpedia:scale ;
sh:pattern "^\\d+:\\d+$"
] ;
sh:property [ sh:description "Material used with this model"@en , "Beim Bau des Modells verwendetes Material"@de ;
sh:group example:PhysicalPropertiesGroup ;
sh:name "Artwork material" ;
sh:path schema:artworkSurface ;
sh:class example:Material ;
] .

example:Dataset
a sh:NodeShape ;
sh:property [ sh:datatype rdf:langString ;
sh:languageIn ( "en" "de" ) ;
sh:uniqueLang true ;
sh:description "The name of the dataset" , "Der Name des Datensatzes"@de ;
sh:minCount 1 ;
sh:maxCount 2 ;
sh:name "Name" ;
sh:path dcterms:title
] ;
sh:property [ dash:singleLine false ;
sh:datatype rdf:langString ;
sh:languageIn ( "en" "de" ) ;
sh:uniqueLang true ;
sh:description "Description of the dataset" ;
sh:minCount 1 ;
sh:maxCount 2 ;
sh:name "Description" ;
sh:path dcterms:description
] ;
sh:property [ sh:description "License of the dataset" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "License" ;
sh:nodeKind sh:IRI ;
sh:path dcterms:license ;
sh:in (
# see below how labels are added to the list entries
<http://creativecommons.org/licenses/by/4.0/>
<http://creativecommons.org/licenses/by-nc/4.0/>
)
] ;
sh:property [ sh:datatype xsd:date ;
sh:description "Date when this dataset has been issued" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Issued" ;
sh:path dcterms:issued
] ;
sh:property [ sh:name "Attribution" ;
sh:node example:Attribution ;
sh:path prov:qualifiedAttribution
] ;
sh:targetClass dcat:Dataset .
a sh:NodeShape ;
sh:property [ sh:datatype rdf:langString ;
sh:languageIn ( "en" "de" ) ;
sh:uniqueLang true ;
sh:description "The name of the dataset" , "Der Name des Datensatzes"@de ;
sh:minCount 1 ;
sh:maxCount 2 ;
sh:name "Name" ;
sh:path dcterms:title
] ;
sh:property [ dash:singleLine false ;
sh:datatype rdf:langString ;
sh:languageIn ( "en" "de" ) ;
sh:uniqueLang true ;
sh:description "Description of the dataset" ;
sh:minCount 1 ;
sh:maxCount 2 ;
sh:name "Description" ;
sh:path dcterms:description
] ;
sh:property [ sh:description "License of the dataset" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "License" ;
sh:nodeKind sh:IRI ;
sh:path dcterms:license ;
sh:in (
# see below how labels are added to the list entries
<http://creativecommons.org/licenses/by/4.0/>
<http://creativecommons.org/licenses/by-nc/4.0/>
)
] ;
sh:property [ sh:datatype xsd:date ;
sh:description "Date when this dataset has been issued" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Issued" ;
sh:path dcterms:issued
] ;
sh:property [ sh:name "Attribution" ;
sh:node example:Attribution ;
sh:path prov:qualifiedAttribution
] ;
sh:targetClass dcat:Dataset .

example:PhysicalPropertiesGroup
a sh:PropertyGroup ;
rdfs:label "Physical properties" .
a sh:PropertyGroup ;
rdfs:label "Physical properties" .

example:Location
a sh:NodeShape ;
rdfs:label "Location" ;
sh:property [ sh:datatype geo:wktLiteral ;
sh:description "Format WKT, e.g. POINT(8.65 49.87)" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Coordinates" ;
sh:path geo:asWKT ;
sh:pattern "^POINT\\([+\\-]?(?:[0-9]*[.])?[0-9]+ [+\\-]?(?:[0-9]*[.])?[0-9]+\\)|POLYGON\\(\\((?:[+\\-]?(?:[0-9]*[.])?[0-9]+[ ,]?){3,}\\)\\)$"
] ;
sh:property [ sh:description "Description of the location" ;
sh:maxCount 1 ;
sh:name "Description" ;
sh:path dcterms:description
] ;
sh:targetClass dcterms:Location .
a sh:NodeShape ;
rdfs:label "Location" ;
sh:property [ sh:datatype geo:wktLiteral ;
sh:description "Format WKT, e.g. POINT(8.65 49.87)" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Coordinates" ;
sh:path geo:asWKT ;
sh:pattern "^POINT\\([+\\-]?(?:[0-9]*[.])?[0-9]+ [+\\-]?(?:[0-9]*[.])?[0-9]+\\)|POLYGON\\(\\((?:[+\\-]?(?:[0-9]*[.])?[0-9]+[ ,]?){3,}\\)\\)$"
] ;
sh:property [ sh:description "Description of the location" ;
sh:maxCount 1 ;
sh:name "Description" ;
sh:path dcterms:description
] ;
sh:targetClass dcterms:Location .

example:Person
a sh:NodeShape ;
rdfs:label "Person" ;
sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Name" ;
sh:path foaf:name
] ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:name "ORCID ID" ;
sh:path dcterms:identifier ;
sh:pattern "^https://orcid.org/\\d{4}-\\d{4}-\\d{4}-\\d{4}$"
] ;
sh:targetClass foaf:Person .
a sh:NodeShape ;
rdfs:label "Person" ;
sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Name" ;
sh:path foaf:name
] ;
sh:property [ sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:name "ORCID ID" ;
sh:path dcterms:identifier ;
sh:pattern "^https://orcid.org/\\d{4}-\\d{4}-\\d{4}-\\d{4}$"
] ;
sh:targetClass foaf:Person .

example:Organisation
a sh:NodeShape ;
rdfs:label "Organisation" ;
sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Name" ;
sh:path foaf:name
] ;
sh:targetClass foaf:Organisation .
a sh:NodeShape ;
rdfs:label "Organisation" ;
sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:name "Name" ;
sh:path foaf:name
] ;
sh:property [ sh:name "Address" ;
sh:path example:Address
] ;
sh:targetClass foaf:Organisation .

example:Attribution
a sh:NodeShape ;
# load an external taxonomy, which will be added to the shapes graph. In this case, the taxonomy provides class instances of prov:Role.
owl:imports <https://w3id.org/nfdi4ing/metadata4ing/> ;
a sh:NodeShape ;
# Import an external taxonomy to the shapes graph.
# In this case, the taxonomy provides class instances of prov:Role,
# which will be displayed in a dropdown to select from.
owl:imports <https://w3id.org/nfdi4ing/metadata4ing/> ;

sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:path prov:agent ;
sh:or (
[ sh:node example:Person ; rdfs:label "Person" ]
[ sh:node example:Organisation ; rdfs:label "Organisation" ]
)
] ;
sh:property [ sh:name "Role" ;
sh:minCount 1 ;
sh:path dcat:hadRole ;
sh:class prov:Role
] ;
sh:targetClass prov:Attribution .
sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:path prov:agent ;
sh:or (
[ sh:node example:Person ; rdfs:label "Person" ]
[ sh:node example:Organisation ; rdfs:label "Organisation" ]
)
] ;
sh:property [ sh:name "Role" ;
sh:minCount 1 ;
sh:path dcat:hadRole ;
sh:class prov:Role
] ;
sh:targetClass prov:Attribution .

# add a label to the license IRIs
<http://creativecommons.org/licenses/by/4.0/> rdfs:label "CC-BY" .
Expand Down
Loading

0 comments on commit 60dd162

Please sign in to comment.