// Now remove statements where their object is not of this type from this cardinality failure
StmtIterator it1e = input.listStatements( input.createResource( repair.listObjectsOfProperty( curr, EYE.cardinalityFailure ).nextNode().asNode().getURI() ), input.createProperty( repair.listObjectsOfProperty( curr, EYE.onProperty ).nextNode().asNode().getURI() ), (RDFNode)null );
Model remStat = ModelFactory.createDefaultModel();
while ( it1e.hasNext() && numVals > maxCard ) // No sense removing more statements than we absolutely have to
{
Statement testing = it1e.nextStatement();
String datatype = testing.getObject().asNode().getLiteralDatatypeURI();
if ( datatype == null )
datatype = defaultURI;
if ( datatype != decided )
{
Resource bn = repair.createResource();
remStat.add( curr, EYE.statementRemoved, bn )
.add( bn, RDF.type, RDF.Statement )
.add( bn, RDF.subject, testing.getSubject() )
.add( bn, RDF.predicate, testing.getPredicate() )
.add( bn, RDF.object, testing.getObject() );
numVals--;
}
}
if ( remStat.size() > 0 )