private IRIConstant getIndividual(OWLAnnotationSubject subject) throws TranslationException { if (subject instanceof IRI) { return termFactory.getConstantIRI(rdfFactory.createIRI(((IRI)subject).asIRI().get().toString())); } else throw new OWLAPITranslatorOWL2QL.TranslationException("Found anonymous individual, this feature is not supported:" + subject); }
private Constant getValue(OWLAnnotationValue value) throws TranslationException { try { if (value instanceof IRI) { return termFactory.getConstantIRI(rdfFactory.createIRI(value.asIRI().get().toString())); } else if (value instanceof OWLLiteral) { return getValueOfLiteral(value.asLiteral().get()); } else throw new OWLAPITranslatorOWL2QL.TranslationException("Found anonymous individual, this feature is not supported:" + value); } catch (OWLRuntimeException ore) { throw new OWLAPITranslatorOWL2QL.TranslationException(ore.getMessage()); } }
private IRIConstant getIndividual(OWLIndividual ind) throws TranslationException { if (ind.isAnonymous()) throw new OWLAPITranslatorOWL2QL.TranslationException("Found anonymous individual, this feature is not supported:" + ind); return termFactory.getConstantIRI(rdfFactory.createIRI(ind.asOWLNamedIndividual().getIRI().toString())); }
final ObjectConstant c; if (subject instanceof IRI) { c = termFactory.getConstantIRI(rdfFactory.createIRI(subject.stringValue())); ObjectConstant c2 = termFactory.getConstantIRI(rdfFactory.createIRI(object.stringValue())); return builder.createObjectPropertyAssertion(predicateName, c, c2);
return termFactory.getConstantIRI(rdfFactory.createIRI(stringValue.trim()));
private Constant getConstant(ProjectionElem node, OntopBindingSet bindingSet) throws OntopResultConversionException, OntopConnectionException { Constant constant = null; String node_name = node.getSourceName(); ValueExpr ve = null; if (extMap != null) { ve = extMap.get(node_name); if (ve != null && ve instanceof Var) throw new OntopResultConversionException("Invalid query. Found unbound variable: " + ve); } // if (node_name.charAt(0) == '-') { if (ve instanceof org.eclipse.rdf4j.query.algebra.ValueConstant) { org.eclipse.rdf4j.query.algebra.ValueConstant vc = (org.eclipse.rdf4j.query.algebra.ValueConstant) ve; if (vc.getValue() instanceof IRI) { constant = termFactory.getConstantIRI(rdfFactory.createIRI(vc.getValue().stringValue())); } else if (vc.getValue() instanceof Literal) { constant = termFactory.getConstantLiteral(vc.getValue().stringValue()); } else { constant = termFactory.getConstantBNode(vc.getValue().stringValue()); } } else { constant = bindingSet.getConstant(node_name); } return constant; }