public Shape withPropertyConstraint(InversePropertyConstraint constraint) { checkNotNull(constraint); URI predicate = constraint.predicate(); checkArgument(!this.constraints.containsKey(predicate),"Shape already defines constraints for predicate '"+predicate+"'"); this.constraints.put(predicate,constraint); return this; }
shapeInd.addValue(shaclTerm("property"), ipcInd); ipcInd.addValue(vocabularyTerm(RDF.TYPE), externalIndividual(shaclTerm("InversePropertyConstraint"))); ipcInd.addValue(shaclTerm("predicate"), externalIndividual(ipc.predicate())); populateDescription(ipcInd, ipc); populateCardinality(ipcInd, ipc.cardinality()); populateNodeKind(ipcInd, ipc.nodeKind()); populateHasValues(ipcInd, ipc.literals(), translator); populateHasValues(ipcInd, ipc.individuals(dataset), translator); Set<Value> allowedValues=Sets.newHashSet(); allowedValues.addAll(ipc.allowedLiterals()); allowedValues.addAll(ipc.allowedIndividuals(dataset)); populateAllowedValues(ipcInd, allowedValues, translator); populateValueType(ipcInd,ipc.valueType()); populateDatatype(ipcInd,ipc.datatype()); Shape valueShape = ipc.valueShape(); if(valueShape!=null) { populateValueShape(ipcInd,cache.individual(valueShape));
Constraints. inversePropertyConstraint(uri("inverseProperty")). withLabel("inverse-property-constraint"). withComment("An inverse property constraint"). withCardinality(Cardinality.unbound()). withNodeKind(NodeKind.NODE). withDatatype(uri("anotherDatatype")). withValueType(uri("anotherValueType")). withAllowedValues( Literals.duration(31,TimeUnit.DAYS), relativeIndividual(dataSet,"three","template3","path")). withValue( Literals.of(new Date()).date(), externalIndividual(dataSet,"http://www.example.org/external/"),
Constraints. inversePropertyConstraint(uri("inverseProperty")). withLabel("inverse-property-constraint"). withComment("An inverse property constraint"). withCardinality(Cardinality.unbound()). withNodeKind(NodeKind.NODE). withDatatype(uri("anotherDatatype")). withValueType(uri("anotherValueType")). withAllowedValues( Literals.duration(31,TimeUnit.DAYS), relativeIndividual(dataSet,"three","template3","path")). withValue( Literals.of(new Date()).date(), externalIndividual(dataSet,"http://www.example.org/external/"),
public static InversePropertyConstraint inversePropertyConstraint(URI predicate) { return new InversePropertyConstraint(predicate); }