Skip to content

Commit

Permalink
add support for rdf langstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
s-tittel committed Aug 1, 2023
1 parent 30f33e4 commit 252fb66
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 143 deletions.
12 changes: 7 additions & 5 deletions demo/data1.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
<http://example.org/fidbau#4f2a8de3-9fc8-40a9-9237-d5964520ec54>
a dcat:Dataset, fidbau:ArchitectureModelDataset ;
dcterms:title "Einsteinturm" ;
dcterms:description "333";
dcterms:description "Modell des Einsteinturms"@de;
dcterms:description "Model of the Einstein tower"@en;
dcterms:issued "2023-07-27"^^xsd:date;
<http://purl.org/dc/terms/accessRights> "public";
dcterms:license <http://creativecommons.org/licenses/by/4.0/>;
dcterms:spatial [
a dcterms:Location ;
Expand All @@ -20,16 +22,16 @@
schema:material "Holz" ;
<http://www.w3.org/ns/prov#qualifiedAttribution> _:0706162f-c5a3-4954-8cf8-a9d324b313f4 ;
<http://purl.org/dc/terms/creator> _:n1150716783622461953 .

_:n1150716783622461953
<http://xmlns.com/foaf/0.1/name> "Stephan Tittel" ;
<http://xmlns.com/foaf/0.1/mbox> "[email protected]" ;
<http://purl.org/dc/terms/identifier> "https://orcid.org/0000-0002-0048-6835" ;
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Agent> .
a <http://xmlns.com/foaf/0.1/Agent> .

_:b6b4cfca-6b02-43c0-a830-b2375dc4653e <http://xmlns.com/foaf/0.1/name> "123";
a <http://xmlns.com/foaf/0.1/Agent>.
_:1c986e20-c685-47c4-83ca-c22068e07762 <http://xmlns.com/foaf/0.1/name> "123";
a <http://xmlns.com/foaf/0.1/Agent>.

_:0706162f-c5a3-4954-8cf8-a9d324b313f4 a <http://www.w3.org/ns/prov#Attribution>;
<http://www.w3.org/ns/prov#agent> _:1c986e20-c685-47c4-83ca-c22068e07762;
<http://www.w3.org/ns/dcat#hadRole> <http://w3id.org/nfdi4ing/metadata4ing#RegistrationAgency>.
<http://www.w3.org/ns/dcat#hadRole> <http://w3id.org/nfdi4ing/metadata4ing#DataCollector>.
5 changes: 3 additions & 2 deletions demo/shapes1.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ fidbau:Dataset rdf:type sh:NodeShape ;
sh:path dcterms:title
] ;
sh:property [ dash:singleLine false ;
sh:datatype xsd:string ;
sh:datatype rdf:langString ;
sh:description "Description of the dataset" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:maxCount 2 ;
sh:languageIn ( "de" "en" ) ;
sh:name "Abstract" ;
sh:path dcterms:description
] ;
Expand Down
12 changes: 6 additions & 6 deletions demo/shapes3.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ ex:PersonShape
ex:HomePageProperty ;
.

ex:SimplifiedPersonShape
a sh:NodeShape ;
sh:targetNode ex:Jane_Doe ;
rdfs:label "Person (name-only)", "Osoba (tylko imię)"@pl ;
sh:property ex:NameProperty ;
.
#ex:SimplifiedPersonShape
# a sh:NodeShape ;
# sh:targetNode ex:Jane_Doe ;
# rdfs:label "Person (name-only)", "Osoba (tylko imię)"@pl ;
# sh:property ex:NameProperty ;
#.

ex:NameProperty
sh:path schema:name ;
Expand Down
4 changes: 2 additions & 2 deletions src/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ export class ShaclForm extends HTMLElement {
elem.remove()
}

const validator = new SHACLValidator(factory.dataset(this.config.shapesGraph), { factory })
this.config.shapesGraph.deleteGraph("")
this.config.shapesGraph.addQuads(this.toRDF())
const report = await validator.validate(factory.dataset(this.config.shapesGraph))
const dataset = factory.dataset(this.config.shapesGraph)
const report = await new SHACLValidator(dataset, { factory }).validate(dataset)

// for (const result of report.results) {
// // See https://www.w3.org/TR/shacl/#results-validation-result for details
Expand Down
Loading

0 comments on commit 252fb66

Please sign in to comment.