private static String displayBnode(Term term) { return ((BNode) term).getName(); }
private int getObjectConstantUriId(ObjectConstant c, PreparedStatement uriidStm) throws SQLException { // TODO (ROMAN): I am not sure this is entirely correct for blank nodes String uri = (c instanceof BNode) ? ((BNode) c).getName() : ((IRIConstant) c).getIRI().getIRIString(); int uri_id = uriMap.getId(uri); if (uri_id < 0) { uri_id = maxURIId + 1; uriMap.set(uri, uri_id); maxURIId++; // Construct the database INSERT statement uriidStm.setInt(1, uri_id); uriidStm.setString(2, uri); uriidStm.addBatch(); } return uri_id; }
public static Resource getResource(ObjectConstant obj) { if (obj instanceof BNode) return fact.createBNode(((BNode)obj).getName()); else if (obj instanceof URIConstant) return fact.createIRI(((URIConstant)obj).getURI()); else return null; //throw new IllegalArgumentException("Invalid constant as subject!" + obj); }
? ((BNode) term0).getName() // getValue should be removed from Constant : ((ValueConstant) term0).getValue();
? ((BNode) term0).getName() // getValue should be removed from Constant : ((ValueConstant) term0).getValue();
public static Resource getResource(ObjectConstant obj) { if (obj instanceof BNode) return fact.createBNode(((BNode)obj).getName()); else if (obj instanceof IRIConstant) return fact.createIRI(((IRIConstant) obj).getIRI().getIRIString()); else return null; //throw new IllegalArgumentException("Invalid constant as subject!" + obj); }
/*** * Translates from assertion objects into * * @param constant * @return */ public OWLIndividual translate(ObjectConstant constant) { if (constant instanceof IRIConstant) return dataFactory.getOWLNamedIndividual(IRI.create(((IRIConstant)constant).getIRI().getIRIString())); else /*if (constant instanceof BNode)*/ return dataFactory.getOWLAnonymousIndividual(((BNode) constant).getName()); }
sb.append(((BNode) term).getName());
public OWLAnnotationSubject translateAnnotationSubject(ObjectConstant subject) { if (subject instanceof IRIConstant) return IRI.create(((IRIConstant) subject).getIRI().getIRIString()); else if (subject instanceof BNode) return dataFactory.getOWLAnonymousIndividual(((BNode) subject).getName()); else throw new UnexceptedAssertionTermException(subject); }
public OWLAnnotationValue translateAnnotationValue(Constant constant) { if (constant instanceof ValueConstant) return translate((ValueConstant) constant); else if (constant instanceof IRIConstant) return IRI.create(((IRIConstant) constant).getIRI().getIRIString()); else if (constant instanceof BNode) return dataFactory.getOWLAnonymousIndividual(((BNode) constant).getName()); else throw new UnexceptedAssertionTermException(constant); }
literalValue = ((BNode) t).getName(); } else { literalValue = ((ValueConstant) t).getValue();