@Test public void addNode() { Graph g = new SimpleGraph(); BlankNode bNode1 = new BlankNode() { }; BlankNode bNode2 = new BlankNode() { }; IRI property1 = new IRI("http: GraphNode n = new GraphNode(bNode1, g); n.addProperty(property1, bNode2); Assert.assertEquals(1, g.size()); }
public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } }
GraphNode { public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } } }
GraphNode { public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } } GraphNode(RDFTerm resource, Graph graph); }
GraphNode { public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } } GraphNode(RDFTerm resource, Graph graph); Graph getGraph(); RDFTerm getNode(); void deleteNodeContext(); ImmutableGraph getNodeContext(); Iterator<Literal> getLiterals(IRI property); int countObjects(IRI property); Iterator<RDFTerm> getObjects(IRI property); boolean hasProperty(IRI property, RDFTerm object); int countSubjects(IRI property); Iterator<BlankNodeOrIRI> getSubjects(IRI property); Iterator<IRI> getIRIObjects(IRI property); Iterator<IRI> getProperties(); Iterator<IRI> getInverseProperties(); void addProperty(IRI predicate, RDFTerm object); void addPropertyValue(IRI property, Object value); void addInverseProperty(IRI predicate, RDFTerm subject); List<RDFTerm> asList(); void deleteProperties(IRI predicate); void deleteProperty(IRI predicate, RDFTerm object); @Override String toString(); GraphNode replaceWith(BlankNodeOrIRI replacement); GraphNode replaceWith(BlankNodeOrIRI replacement, boolean checkPredicates); Iterator<GraphNode> getObjectNodes(IRI property); Iterator<GraphNode> getSubjectNodes(IRI property); @Override boolean equals(Object obj); @Override int hashCode(); Lock readLock(); Lock writeLock(); }
GraphNode { public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } } GraphNode(RDFTerm resource, Graph graph); Graph getGraph(); RDFTerm getNode(); void deleteNodeContext(); ImmutableGraph getNodeContext(); Iterator<Literal> getLiterals(IRI property); int countObjects(IRI property); Iterator<RDFTerm> getObjects(IRI property); boolean hasProperty(IRI property, RDFTerm object); int countSubjects(IRI property); Iterator<BlankNodeOrIRI> getSubjects(IRI property); Iterator<IRI> getIRIObjects(IRI property); Iterator<IRI> getProperties(); Iterator<IRI> getInverseProperties(); void addProperty(IRI predicate, RDFTerm object); void addPropertyValue(IRI property, Object value); void addInverseProperty(IRI predicate, RDFTerm subject); List<RDFTerm> asList(); void deleteProperties(IRI predicate); void deleteProperty(IRI predicate, RDFTerm object); @Override String toString(); GraphNode replaceWith(BlankNodeOrIRI replacement); GraphNode replaceWith(BlankNodeOrIRI replacement, boolean checkPredicates); Iterator<GraphNode> getObjectNodes(IRI property); Iterator<GraphNode> getSubjectNodes(IRI property); @Override boolean equals(Object obj); @Override int hashCode(); Lock readLock(); Lock writeLock();  }