私はこのデータファイルを持っています:
@prefix ex: <http://example.com/ns#> .
ex:John
a ex:Person ;
a ex:parent ;
a ex:male .
そして、この形状ファイル:
@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 xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ex: <http://example.com/ns#> .
ex:RuleOrderExampleShape
a sh:NodeShape ;
sh:targetClass ex:Person ;
sh:rule [
a sh:SPARQLRule;
rdfs:label "Construct a father if someone is a parent and a male";
sh:prefixes ex: ;
sh:construct """
CONSTRUCT {
$this a ex:uncle .
}
WHERE {
$this a ex:parent .
$this a ex:male .
}
"""
] .
私のコードは現在:
Model dataModel = ModelFactory.createDefaultModel();
dataModel.read(data);
Model shapeModel = ModelFactory.createDefaultModel();
shapeModel.read(shape);
Resource reportResource = ValidationUtil.validateModel(dataModel, shapeModel, true);
新しいトリプル (ex:John a ex:father) を含むモデルを取得するにはどうすればよいですか?