static Resource asResource( Node n, ModelCom m ) { return asResource( n, Resource.class, m ); }
@Override public StmtIterator listStatements() { return IteratorFactory.asStmtIterator( GraphUtil.findAll( graph ), this); }
@Override public Property getProperty( String uri ) { if (uri == null) throw new InvalidPropertyURIException( null ); return IteratorFactory.asProperty( makeURI(uri), this ); }
private NodeIterator listObjectsFor( RDFNode s, RDFNode p ) { ClosableIterator<Node> xit = GraphUtil.listObjects(graph, asNode( s ), asNode( p ) ) ; return IteratorFactory.asRDFNodeIterator( xit, this ); }
private ResIterator listSubjectsFor( RDFNode p, RDFNode o ) { ClosableIterator<Node> xit = GraphUtil.listSubjects( graph, asNode( p ), asNode( o ) ); return IteratorFactory.asResIterator( xit, this ); }
static Property asProperty( Node n, ModelCom m ) { return (Property)asResource( n, Property.class, m ); }
protected StmtIterator listStatements( Resource S, Property P, Node O ) { return IteratorFactory.asStmtIterator ( graph.find( asNode( S ), asNode( P ), O ), this ); }
@Override public Resource getResource( String uri ) { return IteratorFactory.asResource(makeURI(uri),this); }
@Override public StmtIterator listStatements( final Selector selector ) { StmtIterator sts = IteratorFactory.asStmtIterator( findTriplesFrom( selector ), this ); return selector.isSimple() ? sts : new StmtIteratorImpl( sts .filterKeep ( asFilter( selector ) ) ) ; }
@Override public Seq getSeq( String uri ) { return (Seq) IteratorFactory.asResource( makeURI( uri ),Seq.class, this); }
/** Find all the statements matching a pattern. * <p>Return an iterator over all the statements in a model * that match a pattern. The statements selected are those * whose subject matches the <code>subject</code> argument, * whose predicate matches the <code>predicate</code> argument * and whose object matchesthe <code>object</code> argument. * If an argument is <code>null</code> it matches anything.</p> * <p> * The s/p/o terms may refer to resources which are temporarily defined in the "posit" model. * This allows one, for example, to query what resources are of type CE where CE is a * class expression rather than a named class - put CE in the posit arg.</p> * * @return an iterator over the subjects * @param subject The subject sought * @param predicate The predicate sought * @param object The value sought */ @Override public StmtIterator listStatements( Resource subject, Property predicate, RDFNode object, Model posit ) { Iterator<Triple> iter = getInfGraph().find(asNode(subject), asNode(predicate), asNode(object), posit.getGraph()); return IteratorFactory.asStmtIterator(iter,this); }
@Override public Bag getBag( String uri ) { return (Bag) IteratorFactory.asResource( makeURI( uri ),Bag.class, this ); }
/** Find all the statements matching a pattern. * <p>Return an iterator over all the statements in a model * that match a pattern. The statements selected are those * whose subject matches the <code>subject</code> argument, * whose predicate matches the <code>predicate</code> argument * and whose object matches the <code>object</code> argument. * If an argument is <code>null</code> it matches anything.</p> * <p> * The s/p/o terms may refer to resources which are temporarily defined in the "posit" model. * This allows one, for example, to query what resources are of type CE where CE is a * class expression rather than a named class - put CE in the posit arg.</p> * * @return an iterator over the subjects * @param subject The subject sought * @param predicate The predicate sought * @param object The value sought * @param posit Model containing additional assertions to be considered when matching statements */ @Override public StmtIterator listStatements( Resource subject, Property predicate, RDFNode object, Model posit ) { if (getGraph() instanceof InfGraph) { Graph gp = posit == null ? ModelFactory.createDefaultModel().getGraph() : posit.getGraph(); Iterator<Triple> iter = getInfGraph().find( asNode(subject), asNode(predicate), asNode(object), gp ); return IteratorFactory.asStmtIterator(iter,this); } else { return null; } }
@Override public Alt getAlt( String uri ) { return (Alt) IteratorFactory.asResource( makeURI(uri) ,Alt.class, this ); }
@Override public Resource createResource() { return IteratorFactory.asResource( NodeFactory.createAnon(),this ); }