- From: Gary Murphy <gary@schemaapp.com>
- Date: Fri, 14 Sep 2018 14:43:23 -0400
- To: public-shacl@w3.org
- Message-ID: <CADnyxpug17GLWTvVSCdBabgQpd2w89oF=k3e0FMchYF4Ho07wQ@mail.gmail.com>
two more shacl puzzles that I'm hoping to transpose from spin:
First involves the string value of what would be $this in a sh:ask clause;
the problem is to ensure that the base URI of the current focus instance is
different from the base URL of the schema:url property. In SPARQL this
would be something possibly like ...
sh:validator [
sh:ask """
ASK {
OPTIONAL {
$this schema:url ?url .
BIND(CONCAT(str($this),'#') AS ?me ) .
BIND(CONCAT(str(?url),'#') AS ?it ) .
FILTER( STRBEFORE(?me,'#') != STRBEFORE(str(?it),'#') )
}
}""" ] ;
Can this be restated in pure SHACL?
Another issue is in ensuring that all superclasses of the current focus
instance are disjoint. Again, in my (probably naive) validator rule:
sh:validator [
sh:ask """
ASK {
$this a ?class1 .
$this a ?class2 .
FILTER (?class1 != ?class2) .
?class1 (rdfs:subClassOf)* ?parent1 .
?class2 (rdfs:subClassOf)* ?parent2 .
?parent1 owl:disjointWith ?parent2 .
}""" ] ;
--
Gary Lawrence Murphy <gary@schemaapp.com> - Hunch Manifest, 15 Wyndham N
'C', Guelph
Received on Friday, 14 September 2018 18:43:58 UTC