Hello Kai Liu,
yes this was slightly incorrect. Fortunately those conversion rules are
model-driven and encoded as SHACL rules that you can simply replace
yourself. I have attached the fixed version that you can replace in your
workspace (TopBraid/SHACL folder). The fix will also go into the final
7.1 release.
Thanks
Holger
On 2021-11-17 11:57 pm, Kai Liu wrote:
Currently, EDG generates cardinality in the approximated OWL file as
follows:
owl:maxCardinality 2 ;
According to the turtle spec
(https://www.w3.org/TR/turtle/#turtle-literals), a number w/o explicit
type declaration has a data type /xsd:integer/.
According to OWL2 spec
(https://www.w3.org/TR/owl2-rdf-based-semantics/#Semantic_Conditions_for_Datatype_Restrictions),
axioms like cardinalities are defined like this:
owl:maxCardinality rdf:type rdf:Property .
owl:maxCardinality rdfs:domain owl:Restriction .
owl:maxCardinality rdfs:range xsd:nonNegativeInteger .
So, I expect to get "owl:maxCardinality "2"^^xsd:nonNegativeInteger"
from the generator.
--
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/10f18347-3a10-496a-9ae2-54ec84f79a2bn%40googlegroups.com
<https://groups.google.com/d/msgid/topbraid-users/10f18347-3a10-496a-9ae2-54ec84f79a2bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups "TopBraid
Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/topbraid-users/ab08059e-eb6a-a3fd-f21b-78473551582a%40topquadrant.com.
# baseURI: http://datashapes.org/shacl2owl
# imports: http://datashapes.org/shacl2rdfs
# prefix: shacl2owl
@prefix dash: <http://datashapes.org/dash#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix shacl2owl: <http://datashapes.org/shacl2owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://datashapes.org/shacl2owl>
a owl:Ontology ;
rdfs:comment "A collection of SHACL rules that take a SHACL ontology as input
and produce corresponding OWL statements, and via its owl:import also RDF
Schema statements." ;
rdfs:label "SHACL to OWL conversion rules" ;
owl:imports <http://datashapes.org/shacl2rdfs> ;
.
shacl2owl:PropertyShapeShape
a sh:NodeShape ;
rdfs:label "Property shape shape for OWL" ;
sh:rule shacl2owl:addAllValuesFrom ;
sh:rule shacl2owl:addMaxCardinality ;
sh:rule shacl2owl:addMinCardinality ;
sh:rule shacl2owl:addTypeOWLDatatypeProperty ;
sh:rule shacl2owl:addTypeOWLObjectProperty ;
sh:targetObjectsOf sh:property ;
.
shacl2owl:addAllValuesFrom
a sh:SPARQLRule ;
rdfs:label "add allValuesFrom" ;
sh:construct """CONSTRUCT {
?class rdfs:subClassOf ?restriction .
?restriction a owl:Restriction .
?restriction owl:onProperty ?path .
?restriction owl:allValuesFrom ?filler .
}
WHERE {
$this sh:class|sh:datatype ?filler .
$this sh:path ?path .
FILTER isIRI(?path) .
?class sh:property $this .
BIND (BNODE() AS ?restriction)
}""" ;
sh:prefixes <http://datashapes.org/dash> ;
.
shacl2owl:addMaxCardinality
a sh:SPARQLRule ;
rdfs:label "add max cardinality" ;
sh:construct """CONSTRUCT {
?class rdfs:subClassOf ?restriction .
?restriction a owl:Restriction .
?restriction owl:onProperty ?path .
?restriction owl:maxCardinality ?maxCardinality .
}
WHERE {
$this sh:maxCount ?maxCount .
$this sh:path ?path .
FILTER isIRI(?path) .
?class sh:property $this .
BIND (BNODE() AS ?restriction)
BIND (xsd:nonNegativeInteger(?maxCount) AS ?maxCardinality) .
}""" ;
sh:prefixes <http://datashapes.org/dash> ;
.
shacl2owl:addMinCardinality
a sh:SPARQLRule ;
rdfs:label "add min cardinality" ;
sh:construct """CONSTRUCT {
?class rdfs:subClassOf ?restriction .
?restriction a owl:Restriction .
?restriction owl:onProperty ?path .
?restriction owl:minCardinality ?minCardinality .
}
WHERE {
$this sh:minCount ?minCount .
$this sh:path ?path .
FILTER isIRI(?path) .
?class sh:property $this .
BIND (BNODE() AS ?restriction) .
BIND (xsd:nonNegativeInteger(?minCount) AS ?minCardinality) .
}""" ;
sh:prefixes <http://datashapes.org/dash> ;
.
shacl2owl:addTypeOWLDatatypeProperty
a sh:SPARQLRule ;
rdfs:label "add type owl:DatatypeProperty" ;
sh:construct """CONSTRUCT {
?path a owl:DatatypeProperty .
}
WHERE {
$this sh:path ?path .
FILTER (isIRI(?path)) .
FILTER (
EXISTS { $this sh:datatype ?anyDatatype } ||
EXISTS { $this sh:nodeKind sh:Literal }
)
}""" ;
sh:prefixes <http://datashapes.org/dash> ;
.
shacl2owl:addTypeOWLObjectProperty
a sh:SPARQLRule ;
rdfs:label "add type owl:ObjectProperty" ;
sh:construct """CONSTRUCT {
?path a owl:ObjectProperty .
}
WHERE {
$this sh:path ?path .
FILTER (isIRI(?path)) .
FILTER (
EXISTS { $this sh:class ?anyClass } ||
EXISTS { $this sh:nodeKind sh:BlankNode } ||
EXISTS { $this sh:nodeKind sh:BlankNodeOrIRI } ||
EXISTS { $this sh:nodeKind sh:IRI }
)
}""" ;
sh:prefixes <http://datashapes.org/dash> ;
.