congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ValueFactory.createBNode
Code IndexAdd Tabnine to your IDE (free)

How to use
createBNode
method
in
org.eclipse.rdf4j.model.ValueFactory

Best Java code snippets using org.eclipse.rdf4j.model.ValueFactory.createBNode (Showing top 20 results out of 414)

origin: org.apache.any23/apache-any23-core

/**
 * Creates a {@link BNode}.
 * @param id string representation of the {@link org.eclipse.rdf4j.model.BNode}
 * @return the valid {@link org.eclipse.rdf4j.model.BNode}
 */
// TODO: replace this with all occurrences of #getBNode()
public static BNode bnode(String id) {
  return valueFactory.createBNode(id);
}
origin: org.apache.any23/apache-any23-core

/**
 * @return a <code>bnode</code> with unique id.
 */
public static BNode bnode() {
  return valueFactory.createBNode();
}
origin: org.apache.any23/apache-any23-core

@Override
public BNode createBNode(String id) {
  if (id == null)
    return null;
  return wrappedFactory.createBNode(id);
}
origin: jbarrasa/neosemantics

private Resource getResource(String s, ValueFactory vf) {
  // taken from org.eclipse.rdf4j.model.impl.SimpleIRI
  // explicit storage of blank nodes in the graph to be considered
  if(s.indexOf(58) >= 0){
    return vf.createIRI(s);
  } else{
    return vf.createBNode(s);
  }
}
origin: org.eclipse.rdf4j/rdf4j-client

private BNode readBnode()
  throws IOException
{
  String bnodeID = readString();
  return valueFactory.createBNode(bnodeID);
}
origin: org.eclipse.rdf4j/rdf4j-client

/**
 * Creates a new {@link BNode} object.
 */
@Deprecated
protected BNode createBNode() throws RDFParseException {
  try {
    return valueFactory.createBNode();
  } catch (Exception e) {
    reportFatalError(e);
    return null; // required by compiler
  }
}
origin: org.eclipse.rdf4j/rdf4j-rio-api

/**
 * Creates a new {@link BNode} object.
 */
@Deprecated
protected BNode createBNode() throws RDFParseException {
  try {
    return valueFactory.createBNode();
  } catch (Exception e) {
    reportFatalError(e);
    return null; // required by compiler
  }
}
origin: org.eclipse.rdf4j/rdf4j-client

public JSONLDInternalTripleCallback(RDFHandler nextHandler, ValueFactory vf) {
  this(nextHandler, vf, new ParserConfig(), new ParseErrorLogger(), nodeID -> vf.createBNode(nodeID),
      () -> vf.createBNode());
}
origin: org.eclipse.rdf4j/rdf4j-queryparser-serql

@Override
public ValueConstant visit(ASTBNode node, Object data)
  throws VisitorException
{
  return new ValueConstant(valueFactory.createBNode(node.getID()));
}
origin: org.eclipse.rdf4j/rdf4j-client

@Override
public ValueConstant visit(ASTBNode node, Object data)
  throws VisitorException
{
  return new ValueConstant(valueFactory.createBNode(node.getID()));
}
origin: owlcs/owlapi

  /**
   * @param node subject or object node
   * @param vf value factory
   * @return blank node
   */
  protected static BNode node(final RDFNode node, final ValueFactory vf) {
    if (node.getIRI().getNamespace().startsWith("_:")) {
      return vf.createBNode(node.getIRI().toString().substring(2));
    }
    return vf.createBNode(node.getIRI().toString());
  }
}
origin: net.sourceforge.owlapi/owlapi-rio

  /**
   * @param node subject or object node
   * @param vf value factory
   * @return blank node
   */
  protected static BNode node(final RDFNode node, final ValueFactory vf) {
    if (node.getIRI().getNamespace().startsWith("_:")) {
      return vf.createBNode(node.getIRI().toString().substring(2));
    }
    return vf.createBNode(node.getIRI().toString());
  }
}
origin: it.unibz.inf.ontop/ontop-rdf4j

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

origin: de.tudarmstadt.ukp.inception.app/inception-kb

private String generateIdentifier(RepositoryConnection conn, KnowledgeBase kb)
{
  ValueFactory vf = conn.getValueFactory();
  // default value of basePrefix is IriConstants.INCEPTION_NAMESPACE
  String basePrefix = kb.getBasePrefix();
  return basePrefix + vf.createBNode().getID();
}
origin: inception-project/inception

private Set<Statement> reifyQualifier(KnowledgeBase kb, KBQualifier aQualifier)
{
  Resource statementId = vf.createBNode(aQualifier.getKbStatement().getStatementId());
  KBHandle qualifierProperty = aQualifier.getKbProperty();
  IRI qualifierPredicate = vf.createIRI(qualifierProperty.getIdentifier());
  Value qualifierValue = valueMapper.mapQualifierValue(aQualifier, vf);
  Statement qualifierStatement = vf
    .createStatement(statementId, qualifierPredicate, qualifierValue);
  Set<Statement> originalStatements = new HashSet<>();
  originalStatements.add(qualifierStatement); //id P V
  return originalStatements;
}
origin: ontop/ontop

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);
}
origin: de.tudarmstadt.ukp.inception.app/inception-kb

private Set<Statement> reifyQualifier(KnowledgeBase kb, KBQualifier aQualifier)
{
  Resource statementId = vf.createBNode(aQualifier.getKbStatement().getStatementId());
  KBHandle qualifierProperty = aQualifier.getKbProperty();
  IRI qualifierPredicate = vf.createIRI(qualifierProperty.getIdentifier());
  Value qualifierValue = valueMapper.mapQualifierValue(aQualifier, vf);
  Statement qualifierStatement = vf
    .createStatement(statementId, qualifierPredicate, qualifierValue);
  Set<Statement> originalStatements = new HashSet<>();
  originalStatements.add(qualifierStatement); //id P V
  return originalStatements;
}
origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-sail-inferencer

  private void addQueryNode(Model m, Resource implNode, IRI predicate, String queryText) {
    if (null != queryText) {
      ValueFactory factory = SimpleValueFactory.getInstance();
      BNode queryNode = factory.createBNode();
      m.add(implNode, predicate, queryNode);
      m.add(queryNode, RDF.TYPE, SP.CONSTRUCT_CLASS);
      m.add(queryNode, SP.TEXT_PROPERTY, factory.createLiteral(queryText));
    }
  }
}
origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin

private void visitWhere(TupleExpr where)
  throws RDFHandlerException
{
  Resource whereBNode = valueFactory.createBNode();
  handler.handleStatement(valueFactory.createStatement(subject, SP.WHERE_PROPERTY, whereBNode));
  isSubQuery = true; // further projection elements are for
            // sub-queries
  ListContext ctx = newList(whereBNode);
  where.visit(this);
  endList(ctx);
}
origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin

@Override
public void meet(InsertData node)
  throws RDFHandlerException
{
  Resource dataList = valueFactory.createBNode();
  handler.handleStatement(valueFactory.createStatement(subject, SP.DATA_PROPERTY, dataList));
  ListContext dataCtx = newList(dataList);
  renderDataBlock(node.getDataBlock());
  endList(dataCtx);
}
org.eclipse.rdf4j.modelValueFactorycreateBNode

Javadoc

Creates a new bNode.

Popular methods of ValueFactory

  • createIRI
    Creates a new IRI from the supplied namespace and local name. Calling this method is funtionally equ
  • createLiteral
  • createStatement
    Creates a new statement with the supplied subject, predicate and object and associated context.
  • createURI
    Creates a new URI from the supplied namespace and local name.

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now