Codota Logo
OntopBindingSet.getConstant
Code IndexAdd Codota to your IDE (free)

How to use
getConstant
method
in
it.unibz.inf.ontop.answering.resultset.OntopBindingSet

Best Java code snippets using it.unibz.inf.ontop.answering.resultset.OntopBindingSet.getConstant (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: ontop/ontop

@Override
@Nullable
public Value getValue(String variableName) {
  try {
    final Constant constant = ontopBindingSet.getConstant(variableName);
    return constant == null?
        null:
        RDF4JHelper.getValue(constant);
  } catch (OntopResultConversionException e) {
    throw new RuntimeException(e);
  }
}
origin: it.unibz.inf.ontop/ontop-rdf4j

@Override
@Nullable
public Value getValue(String bindingName) {
  if (!hasBinding(bindingName)) {
    return null;
  } else {
    try {
      final Constant constant = ontopBindingSet.getConstant(bindingName);
      return RDF4JHelper.getValue(constant);
    } catch (OntopResultConversionException e) {
      throw new RuntimeException(e);
    }
  }
}
origin: ontop/ontop

@Override
public OWLNamedIndividual getOWLNamedIndividual(int column) throws OWLException {
  try {
    return (OWLNamedIndividual) translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLObject getOWLObject(String column) throws OWLException {
  try {
    return translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLLiteral getOWLLiteral(int column) throws OWLException {
  try {
    return (OWLLiteral) translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLIndividual getOWLIndividual(int column) throws OWLException {
  try {
    return (OWLIndividual) translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLObject getOWLObject(int column) throws OWLException {
  try {
    return translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLIndividual getOWLIndividual(String column) throws OWLException {
  try {
    return (OWLIndividual) translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLLiteral getOWLLiteral(String column) throws OWLException {
  try {
    return (OWLLiteral) translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

@Override
public OWLPropertyAssertionObject getOWLPropertyAssertionObject(int column) throws OWLException {
  try {
    return translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e + " Column: " + column);
  }
}
origin: ontop/ontop

@Override
public OWLAnonymousIndividual getOWLAnonymousIndividual(int column) throws OWLException {
  try {
    return (OWLAnonymousIndividual) translate(ontopBindingSet.getConstant(column));
  } catch (Exception e) {
    throw new OntopOWLException(e);
  }
}
origin: ontop/ontop

while (resultSet.hasNext()) {
  final OntopBindingSet bindingSet = resultSet.next();
  Constant constant = bindingSet.getConstant(1);
  if (constant instanceof IRIConstant) {
origin: ontop/ontop

  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;
  }

it.unibz.inf.ontop.answering.resultsetOntopBindingSetgetConstant

Javadoc

Returns the constant at column "column" recall that columns start at index 1.

Popular methods of OntopBindingSet

  • getBinding
    If all bindings are needed, less efficient than getBindings() or the iterator
  • getBindingNames
  • getBindings
  • hasBinding
  • iterator

Popular in Java

  • Creating JSON documents from java classes using gson
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Menu (java.awt)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now