public static ValueConstant constant(String value){ return TERM_FACTORY.getConstantLiteral(value); }
private ImmutableTerm typeTerm(String text, IRI datatype) { ValueConstant integerConstant = termFactory.getConstantLiteral(text, datatype); return termFactory.getImmutableTypedTerm(integerConstant, datatype); }
private Term typeTerm(String text, COL_TYPE col_type) { ValueConstant integerConstant = TERM_FACTORY.getConstantLiteral(text, COL_TYPE.LITERAL); return TERM_FACTORY.getTypedTerm(integerConstant, col_type); }
private void process(String value, IRI datatype) { result = termFactory.getConstantLiteral(value, typeFactory.getDatatype(datatype)); }
private Function get_REPLACE(ImmutableList<Term> terms, net.sf.jsqlparser.expression.Function expression) { Term flags = termFactory.getConstantLiteral(""); switch (terms.size()) { case 2: return termFactory.getFunction( ExpressionOperation.REPLACE, terms.get(0), terms.get(1), termFactory.getConstantLiteral(""), flags); case 3: return termFactory.getFunction( ExpressionOperation.REPLACE, terms.get(0), terms.get(1), terms.get(2), flags); } throw new InvalidSelectQueryRuntimeException("Wrong number of arguments in SQL function", expression); }
private static Function get_REPLACE(ImmutableList<Term> terms, net.sf.jsqlparser.expression.Function expression) { Term flags = TERM_FACTORY.getConstantLiteral(""); switch (terms.size()) { case 2: return TERM_FACTORY.getFunction( ExpressionOperation.REPLACE, terms.get(0), terms.get(1), TERM_FACTORY.getConstantLiteral(""), flags); case 3: return TERM_FACTORY.getFunction( ExpressionOperation.REPLACE, terms.get(0), terms.get(1), terms.get(2), flags); } throw new InvalidSelectQueryRuntimeException("Wrong number of arguments in SQL function", expression); }
@Override public ImmutableTerm visitLitString(LitStringContext ctx) { String str = ctx.STRING_LITERAL_QUOTE().getText(); if (str.contains("{")) { return getNestedConcat(str); } return termFactory.getConstantLiteral(str.substring(1, str.length() - 1), XSD.STRING); // without the double quotes }
private Function get_REGEXP_LIKE(ImmutableList<Term> terms, net.sf.jsqlparser.expression.Function expression) { // Oracle only: // a source string, a regex pattern (POSIX regular expression), an optional flags switch (terms.size()) { case 2: return termFactory.getFunction( ExpressionOperation.REGEX, terms.get(0), terms.get(1), termFactory.getConstantLiteral("")); case 3: // check the flag? return termFactory.getFunction( ExpressionOperation.REGEX, terms.get(0), terms.get(1), terms.get(2)); } throw new InvalidSelectQueryRuntimeException("Wrong number of arguments for SQL function", expression); }
private static Function get_REGEXP_LIKE(ImmutableList<Term> terms, net.sf.jsqlparser.expression.Function expression) { // Oracle only: // a source string, a regex pattern (POSIX regular expression), an optional flags switch (terms.size()) { case 2: return TERM_FACTORY.getFunction( ExpressionOperation.REGEX, terms.get(0), terms.get(1), TERM_FACTORY.getConstantLiteral("")); case 3: // check the flag? return TERM_FACTORY.getFunction( ExpressionOperation.REGEX, terms.get(0), terms.get(1), terms.get(2)); } throw new InvalidSelectQueryRuntimeException("Wrong number of arguments for SQL function", expression); }
@Override public Term visitStringLiteral(StringLiteralContext ctx) { String str = ctx.STRING_LITERAL_QUOTE().getText(); if (str.contains("{")) { return getNestedConcat(str); } return TERM_FACTORY.getConstantLiteral(str.substring(1, str.length() - 1), COL_TYPE.STRING); // without the double quotes }
private ImmutableFunctionalTerm createGroundFunctionalTerm(IRI iri) { return termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(iri.getIRIString())); } }
private GroundFunctionalTerm convertIRIIntoGroundFunctionalTerm(IRI iri) { return (GroundFunctionalTerm) termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(iri.getIRIString())); }
private GroundFunctionalTerm convertIRIIntoGroundFunctionalTerm(IRI iri) { return (GroundFunctionalTerm) termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(iri.getIRIString())); }
private Function convertIRIIntoFunction(IRI iri) { return termFactory.getUriTemplate(termFactory.getConstantLiteral(iri.getIRIString())); }
@Override public void visit(SWRLIndividualArgument node) { //get the id without the quotes <> terms.add(termFactory.getConstantLiteral(node.getIndividual().toStringID(), typeFactory.getXsdStringDatatype())); }
@Override public Term visitLanguageTag(LanguageTagContext ctx) { VariableContext vc = ctx.variable(); if (vc != null) { return visitVariable(vc); } return TERM_FACTORY.getConstantLiteral(ctx.LANGTAG().getText().substring(1).toLowerCase(), COL_TYPE.STRING); }
@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)); }
private ValueConstant getValueOfLiteral(OWLLiteral object) { if (!object.getLang().isEmpty()) { return termFactory.getConstantLiteral(object.getLiteral(), object.getLang()); } else { RDFDatatype type = typeFactory.getDatatype(rdfFactory.createIRI(object.getDatatype().getIRI().toString())); return termFactory.getConstantLiteral(object.getLiteral(), type); } }
@Override public ImmutableTerm visitVerb(VerbContext ctx) { ResourceContext rc = ctx.resource(); if (rc != null) { return visitResource(rc); } return termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(it.unibz.inf.ontop.model.vocabulary.RDF.TYPE.getIRIString())); }
private ImmutableList<TargetAtom> constructTargetQuery(ImmutableFunctionalTerm classTerm, ObjectRDFType type) { Variable X = termFactory.getVariable("X"); ImmutableFunctionalTerm subjectTerm; if (!type.isBlankNode()) subjectTerm = termFactory.getImmutableUriTemplate(X); else { subjectTerm = termFactory.getImmutableBNodeTemplate(X); } ImmutableTerm predTerm = termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral( org.eclipse.rdf4j.model.vocabulary.RDF.TYPE.toString())); TargetAtom targetAtom = targetAtomFactory.getTripleTargetAtom(subjectTerm, predTerm ,classTerm); return ImmutableList.of(targetAtom); }