public static Function uri(Term... terms){ return TERM_FACTORY.getUriTemplate(terms); }
else return termFactory.getUriTemplate(termFactory.getConstantLiteral(String.valueOf(id), typeFactory.getXsdIntegerDatatype()));
private Function convertIRIIntoFunction(IRI iri) { return termFactory.getUriTemplate(termFactory.getConstantLiteral(iri.getIRIString())); }
@Override public Term visitVerb(VerbContext ctx) { ResourceContext rc = ctx.resource(); if (rc != null) { return visitResource(rc); } return TERM_FACTORY.getUriTemplate(TERM_FACTORY.getConstantLiteral(RDF_TYPE)); }
if (token instanceof FixedString) { toReturn = TERM_FACTORY.getUriTemplate(uriTemplate); } else if (token instanceof ColumnString) { toReturn = TERM_FACTORY.getUriTemplate(column); toReturn = TERM_FACTORY.getUriTemplate(terms);
? Maps.immutableEntry(predicateVariable, (ImmutableTerm) termFactory.getUriTemplate( termFactory.getConstantLiteral(newIRI.getIRIString()))) : e)
private static CQIE generateTripleMapping(CQIE rule) { Function newhead; Function currenthead = rule.getHead(); if (currenthead.getArity() == 1) { // head is Class(x) Forming head as triple(x,uri(rdf:type), uri(Class)) Function rdfTypeConstant = TERM_FACTORY.getUriTemplate(TERM_FACTORY.getConstantLiteral(IriConstants.RDF_TYPE)); String classname = currenthead.getFunctionSymbol().getName(); Term classConstant = TERM_FACTORY.getUriTemplate(TERM_FACTORY.getConstantLiteral(classname)); newhead = ATOM_FACTORY.getTripleAtom(currenthead.getTerm(0), rdfTypeConstant, classConstant); } else if (currenthead.getArity() == 2) { // head is Property(x,y) Forming head as triple(x,uri(Property), y) String propname = currenthead.getFunctionSymbol().getName(); Function propConstant = TERM_FACTORY.getUriTemplate(TERM_FACTORY.getConstantLiteral(propname)); newhead = ATOM_FACTORY.getTripleAtom(currenthead.getTerm(0), propConstant, currenthead.getTerm(1)); } else { // head is triple(x,uri(Property),y) newhead = (Function) currenthead.clone(); } return DATALOG_FACTORY.getCQIE(newhead, rule.getBody()); } }
head = TERM_FACTORY.getFunction(p, TERM_FACTORY.getUriTemplate( TERM_FACTORY.getConstantLiteral(s.getURI())), TERM_FACTORY.getTypedTerm(TERM_FACTORY.getConstantLiteral(o.getValue()), o.getLanguage())); } else { head = TERM_FACTORY.getFunction(p, TERM_FACTORY.getUriTemplate( TERM_FACTORY.getConstantLiteral(s.getURI())), TERM_FACTORY.getTypedTerm(o, o.getType())); head = TERM_FACTORY.getFunction(p, TERM_FACTORY.getUriTemplate( TERM_FACTORY.getConstantLiteral(s.getURI())), TERM_FACTORY.getTypedTerm(TERM_FACTORY.getConstantLiteral(o.getValue()), o.getLanguage())); } else { head = TERM_FACTORY.getFunction(p, TERM_FACTORY.getUriTemplate( TERM_FACTORY.getConstantLiteral(s.getURI())), TERM_FACTORY.getTypedTerm(o, o.getType())); TERM_FACTORY.getUriTemplate(TERM_FACTORY.getConstantLiteral(s.getURI())), TERM_FACTORY.getUriTemplate(TERM_FACTORY.getConstantLiteral(o.getURI())));
.map(lang -> atomFactory.getMutableTripleHeadAtom(termFactory.getUriTemplate( termFactory.getConstantLiteral(s.getIRI().getIRIString())), propertyIRI, termFactory.getTypedTerm(termFactory.getConstantLiteral(o.getValue()), lang.getFullString()))) .orElseGet(() -> atomFactory.getMutableTripleHeadAtom(termFactory.getUriTemplate( termFactory.getConstantLiteral(s.getIRI().getIRIString())), propertyIRI, .map(lang -> atomFactory.getMutableTripleHeadAtom(termFactory.getUriTemplate( termFactory.getConstantLiteral(s.getIRI().getIRIString())), propertyIRI, termFactory.getTypedTerm(termFactory.getConstantLiteral(o.getValue()), lang.getFullString()))) .orElseGet(() -> atomFactory.getMutableTripleHeadAtom(termFactory.getUriTemplate( termFactory.getConstantLiteral(s.getIRI().getIRIString())), propertyIRI, termFactory.getUriTemplate(termFactory.getConstantLiteral(s.getIRI().getIRIString())), propertyIRI, termFactory.getUriTemplate(termFactory.getConstantLiteral(o.getIRI().getIRIString())));
Term uriOfPred = TERM_FACTORY.getUriTemplate(pred); Term uriOfObject = TERM_FACTORY.getUriTemplate(object); atom = ATOM_FACTORY.getTripleAtom(subject, uriOfPred, uriOfObject); } else {
Term oTerm; Term pTerm = termFactory.getUriTemplate(termFactory.getConstantLiteral(it.unibz.inf.ontop.model.vocabulary.RDF.TYPE.getIRIString())); if (o == null) { oTerm = getTermForVariable(triple.getObjectVar(), variables); oTerm = termFactory.getUriTemplate(termFactory.getConstantLiteral(o.stringValue())); Term pTerm = termFactory.getUriTemplate(termFactory.getConstantLiteral(p.stringValue())); atom = atomFactory.getMutableTripleAtom(sTerm, pTerm, oTerm);