Closed elena-slavco closed 4 weeks ago
Hi @elena-slavco,
Great that you are working with MIM!
According to the SHACL specification, the sh:datatype property can only be defined for sh:PropertyShape, however in this SPARQL transformation it is defined for sh:NodeShape.
I do not believe sh:datatype
is formally defined to be only useable on sh:PropertyShape
.
The diagram which you refer to is informal, and unfortunately does not reflect the domains and ranges defined in the SHACL ontology, where the domain for sh:datatype
is unspecified, nor does it match the definitions in the SHACL for SHACL shapes, where sh:datatype
is declared to be useable on any sh:Shape
.
Furthermore, the formal definition of sh:datatype
reads:
sh:datatype specifies a condition to be satisfied with regards to the datatype of each value node.
The formal definition of "value node", with regard to node shapes reads:
For node shapes the value nodes are the individual focus nodes, forming a set with exactly one member.
So, I see no issue with using sh:datatype
on a sh:NodeShape
(literals are also nodes, and can also be focus nodes).
A test in the SHACL playground confirms that this is possible:
Hi @pmaria , Thank you very much for the detailed answer. Now it is clear!
I have some follow-up questions. In the query above we have created a NodeShape for datatype. In the queries transform types we will related the datatype to the subject. There are 2 queries:
rdfs:Datatype
, but I havent seen the mapping to rdfs:Datatype
anywhere in the MIM 1.2 queries. ?subject a sh:NodeShape.
. Is this correct? In my case the ?modelelemente
is an Attrubuusoort and sh:PropertyShape in owl, therefore I will not be able to connect the attribute with its datatype. I am currently working with MIM 1.1 and checking some MIM 1.2 for Datatypes. Thank you for your help!
Specifically the following query string:
CONSTRUCT {
?subject sh:datatype ?datatype
}
WHERE {
?modelelement mim:type ?type.
?type rdfs:subClassOf*/rdf:type mim:PrimitiefDatatype.
?subject mim:equivalent ?modelelement.
?datatype mim:equivalent ?type.
?datatype a rdfs:Datatype.
}
Notice that rdfs:Datatype
pops up here, but will not be delivered by an EAPX file (which has no knowledge of RDFS).
@elena-slavco Can you move this rdfs:Datatype
question to a new issue, and close the current issue as answered?
Hi MIM Community,
We are working with MIM 1.2 and noticed that for SPARQL query for transformation of Primitief Datatype (Section 6.4.6.1), there is wrong domain for property
sh:datatype
.According to the SHACL specification, the![Screenshot 2024-05-29 093701 | =250x250](https://github.com/Geonovum/MIM-Werkomgeving/assets/141404332/383781d1-42da-4ad2-ad48-dbb35b5de2ab)
sh:datatype
property can only be defined forsh:PropertyShape
, however in this SPARQL transformation it is defined forsh:NodeShape
. See the image below: