https://ontology.solveit-df.org/solveit/analysis/shapes/HypothesisedTableAttributionShape
Validates the endpoints of a table attribution, and that attributions competing for one record are declared as alternatives.
Focus nodes of this shape (solveit-analysis:HypothesisedTableAttribution) can have the following properties:
| PROPERTY | DESCRIPTION | MIN | MAX | VALUE TYPE | OTHER CONSTRAINTS |
|---|---|---|---|---|---|
uco-core:source |
sh:message The source of a table attribution must be the one HypothesisedRecord being attributed. |
1 | 1 | solveit-analysis:HypothesisedRecord | |
uco-core:target |
sh:message The target of a table attribution must be the one SQLiteTable it is attributed to. |
1 | 1 | solveit-observable:SQLiteTable |
@prefix : <https://ontology.solveit-df.org/solveit/analysis/shapes/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix solveit-analysis: <https://ontology.solveit-df.org/solveit/analysis/> .
@prefix solveit-observable: <https://ontology.solveit-df.org/solveit/observable/> .
@prefix uco-core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
:HypothesisedTableAttributionShape a sh:NodeShape ;
rdfs:label "Hypothesised Table Attribution Shape"@en ;
rdfs:comment "Validates the endpoints of a table attribution, and that attributions competing for one record are declared as alternatives."@en ;
sh:property [ sh:class solveit-analysis:HypothesisedRecord ;
sh:maxCount 1 ;
sh:message "The source of a table attribution must be the one HypothesisedRecord being attributed."@en ;
sh:minCount 1 ;
sh:path uco-core:source ],
[ sh:class solveit-observable:SQLiteTable ;
sh:maxCount 1 ;
sh:message "The target of a table attribution must be the one SQLiteTable it is attributed to."@en ;
sh:minCount 1 ;
sh:path uco-core:target ] ;
sh:sparql [ a sh:SPARQLConstraint ;
sh:message "This record carries more than one table attribution, but they are not grouped in a HypothesisSet, so nothing marks them as competing alternatives."@en ;
sh:select """
SELECT $this WHERE {
$this <https://ontology.unifiedcyberontology.org/uco/core/source> ?rec .
?other <https://ontology.unifiedcyberontology.org/uco/core/source> ?rec .
FILTER (?other != $this)
FILTER NOT EXISTS {
?set a <https://ontology.solveit-df.org/solveit/analysis/HypothesisSet> ;
<https://ontology.solveit-df.org/solveit/analysis/hasHypothesis> $this, ?other .
}
}
""" ],
[ a sh:SPARQLConstraint ;
sh:message "This table attribution is grouped with one about a different record, so they are not competing alternatives."@en ;
sh:select """
SELECT $this WHERE {
?set a <https://ontology.solveit-df.org/solveit/analysis/HypothesisSet> ;
<https://ontology.solveit-df.org/solveit/analysis/hasHypothesis> $this, ?other .
FILTER (?other != $this)
?other a <https://ontology.solveit-df.org/solveit/analysis/HypothesisedTableAttribution> .
$this <https://ontology.unifiedcyberontology.org/uco/core/source> ?a .
?other <https://ontology.unifiedcyberontology.org/uco/core/source> ?b .
FILTER (?a != ?b)
}
""" ],
[ a sh:SPARQLConstraint ;
sh:message "This table attribution is grouped with another naming the same table for the same record, so they are the same claim rather than alternatives."@en ;
sh:select """
SELECT $this WHERE {
?set a <https://ontology.solveit-df.org/solveit/analysis/HypothesisSet> ;
<https://ontology.solveit-df.org/solveit/analysis/hasHypothesis> $this, ?other .
FILTER (?other != $this)
$this <https://ontology.unifiedcyberontology.org/uco/core/source> ?rec ;
<https://ontology.unifiedcyberontology.org/uco/core/target> ?tbl .
?other <https://ontology.unifiedcyberontology.org/uco/core/source> ?rec ;
<https://ontology.unifiedcyberontology.org/uco/core/target> ?tbl .
}
""" ] ;
sh:targetClass solveit-analysis:HypothesisedTableAttribution .