congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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