@Override public RDFNode visit(OWLAnonymousIndividual individual) { return new RDFResourceBlankNode(System.identityHashCode(individual)); }
/** * @param node node to search * @return true if the anon node is shared */ public boolean isAnonymousNodeSharedSubject(RDFResourceBlankNode node) { if(!node.isAnonymous()) { return false; } int count = 0; for(RDFTriple triple : triples) { if(triple.getObject() instanceof RDFResourceBlankNode) { RDFResourceBlankNode object = (RDFResourceBlankNode) triple.getObject(); if(object.equals(node)) { count++; if (count > 1) { return true; } } } } return false; }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFResourceBlankNode) { RDFResourceBlankNode other = (RDFResourceBlankNode) obj; return resource.equals(other.resource); } // Commons RDF BlankNode.equals() contract if (obj instanceof BlankNode) { BlankNode blankNode = (BlankNode) obj; return uniqueReference().equals(blankNode.uniqueReference()); } return false; }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFResourceBlankNode) { RDFResourceBlankNode other = (RDFResourceBlankNode) obj; return resource.equals(other.resource); } // Commons RDF BlankNode.equals() contract if (obj instanceof BlankNode) { BlankNode blankNode = (BlankNode) obj; return uniqueReference().equals(blankNode.uniqueReference()); } return false; }
protected RDFResourceBlankNode getBlankNodeFor(Object key, boolean isIndividual, boolean isAxiom, boolean needId) { Integer id = blankNodeMap.get(key); if (id == null) { id = Integer.valueOf(nextBlankNodeId.getAndIncrement()); blankNodeMap.put(key, id); } return new RDFResourceBlankNode(id, isIndividual, needId, isAxiom); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (obj instanceof RDFResourceBlankNode) { RDFResourceBlankNode other = (RDFResourceBlankNode) obj; return resource.equals(other.resource); } // Commons RDF BlankNode.equals() contract if (obj instanceof BlankNode) { BlankNode blankNode = (BlankNode) obj; return uniqueReference().equals(blankNode.uniqueReference()); } return false; }
protected RDFResourceBlankNode getBlankNodeFor(Object key, boolean isIndividual, boolean isAxiom, boolean needId) { Integer id = blankNodeMap.get(key); if (id == null) { id = Integer.valueOf(nextBlankNodeId.getAndIncrement()); blankNodeMap.put(key, id); } return new RDFResourceBlankNode(id, isIndividual, needId, isAxiom); }
protected RDFResourceBlankNode getBlankNodeFor(Object key, boolean isIndividual, boolean isAxiom, boolean needId) { Integer id = blankNodeMap.get(key); if (id == null) { id = Integer.valueOf(nextBlankNodeId.getAndIncrement()); blankNodeMap.put(key, id); } return new RDFResourceBlankNode(id, isIndividual, needId, isAxiom); }
@Nonnull @Override protected RDFResourceBlankNode getAnonymousNode(@Nonnull Object key) { return new RDFResourceBlankNode(System.identityHashCode(key), false,false, false); }
protected RDFResourceBlankNode getBlankNodeFor(Object key, boolean isIndividual, boolean isAxiom, boolean needId) { Integer id = blankNodeMap.get(key); if (id == null) { id = Integer.valueOf(nextBlankNodeId.getAndIncrement()); blankNodeMap.put(key, id); } return new RDFResourceBlankNode(id, isIndividual, needId, isAxiom); }
@Nonnull @Override protected RDFResource getAnonymousNodeForExpressions(@Nonnull Object key, boolean isAxiom) { checkNotNull(key, "key cannot be null"); return new RDFResourceBlankNode(false, false, isAxiom); }
private static RDFResource getResource(IRI iri, boolean anon, boolean axiom) { if (anon) { return new RDFResourceBlankNode(iri, true, true, axiom); } return new RDFResourceIRI(iri); }
private static RDFResource getResource(IRI iri, boolean anon, boolean axiom) { if (anon) { return new RDFResourceBlankNode(iri, true, true, axiom); } return new RDFResourceIRI(iri); }
private static RDFResource getResource(IRI iri, boolean anon, boolean axiom) { if (anon) { return new RDFResourceBlankNode(iri, true, true, axiom); } return new RDFResourceIRI(iri); }
@Override protected RDFResourceBlankNode getAnonymousNode(Object key) { if (key instanceof OWLAnonymousIndividual) { RDFResourceBlankNode toReturn = new RDFResourceBlankNode( ((OWLAnonymousIndividual) key).getID().getID().hashCode()); //System.out.println("RDFTranslator.getAnonymousNodeTricked() "+key.getClass().getSimpleName()+"\t"+key+"\t"+toReturn); return toReturn; } RDFResourceBlankNode toReturn = new RDFResourceBlankNode( System.identityHashCode(key)); //System.out.println("RDFTranslator.getAnonymousNode() "+key.getClass().getSimpleName()+"\t"+key+"\t"+toReturn); return toReturn; }
private RDFResource getRDFResource(IRI iri) { if(isAnonymousNode(iri)) { return new RDFResourceBlankNode(iri); } else { return new RDFResourceIRI(iri); } }
private RDFResource getRDFResource(IRI iri) { if (isAnonymousNode(iri)) { return new RDFResourceBlankNode(iri, false, false, isAxiomIRI(iri)); } return new RDFResourceIRI(iri); }
private RDFResource getRDFResource(IRI iri) { if (isAnonymousNode(iri)) { return new RDFResourceBlankNode(iri, false, false, isAxiomIRI(iri)); } return new RDFResourceIRI(iri); }
private RDFResource createOntologyHeaderNode() { OWLOntologyID ontID = ontology.getOntologyID(); if(ontID.isAnonymous()) { return new RDFResourceBlankNode(System.identityHashCode(ontology)); } else { return new RDFResourceIRI(ontID.getOntologyIRI()); } }
private RDFResource getRDFResource(IRI iri) { if (isAnonymousNode(iri)) { return new RDFResourceBlankNode(iri, false, false, isAxiomIRI(iri)); } return new RDFResourceIRI(iri); }