BNode virtualProperty = new BNode();
definitionGraph.add(new TripleImpl(virtualProperty, RDF.type, CRIS.JoinVirtualProperty));
BNode listBNode = new BNode();
definitionGraph.add(new TripleImpl(virtualProperty, CRIS.propertyList, listBNode));
List rdfList = new RdfList(listBNode, definitionGraph);
for (VirtualProperty uri : joinVirtualProperty.properties) {
rdfList.add(asResource(uri));
}
return virtualProperty;
} else if (vp instanceof PathVirtualProperty) {
PathVirtualProperty pathVirtualProperty = (PathVirtualProperty) vp;
if (pathVirtualProperty.properties.isEmpty()) {
throw new RuntimeException("vp " + vp + " conatins an empty list");
}
BNode virtualProperty = new BNode();
definitionGraph.add(new TripleImpl(virtualProperty, RDF.type, CRIS.PathVirtualProperty));
BNode listBNode = new BNode();
definitionGraph.add(new TripleImpl(virtualProperty, CRIS.propertyList, listBNode));
List rdfList = new RdfList(listBNode, definitionGraph);
for (UriRef uri : pathVirtualProperty.properties) {
rdfList.add(uri);
}
return virtualProperty;
}
throw new RuntimeException("Could not create resource.");