congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DatasetImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
DatasetImpl
in
org.apache.jena.sparql.core

Best Java code snippets using org.apache.jena.sparql.core.DatasetImpl (Showing top 20 results out of 315)

origin: apache/jena

/** Wrap an existing DatasetGraph */
public static Dataset wrap(DatasetGraph datasetGraph) {
  return new DatasetImpl(datasetGraph) ;
}

origin: apache/jena

/**
 * Wrap a {@link DatasetGraph} to make a dataset
 *
 * @param dataset DatasetGraph
 * @return Dataset
 */
public static Dataset wrap(DatasetGraph dataset) {
  Objects.requireNonNull(dataset, "Can't wrap a null DatasetGraph reference") ;
  return DatasetImpl.wrap(dataset);
}
origin: apache/jena

@Override
public Model getNamedModel(String uri) {
  checkGraphName(uri) ;
  Node n = NodeFactory.createURI(uri) ;
  return graph2model(dsg.getGraph(n)) ;
}
origin: apache/jena

@Override
public ReadWrite transactionMode() {
  checkTransactional();
  return transactional.transactionMode();
}
origin: apache/jena

@Override
public Dataset removeNamedModel(String uri) {
  checkGraphName(uri) ;
  Node n = NodeFactory.createURI(uri) ;
  dsg.removeGraph(n) ;
  return this;
}
origin: apache/jena

private void checkTransactional() {
  if ( ! supportsTransactions() )
    throw new UnsupportedOperationException("Transactions not supported") ;
}
origin: apache/jena

@Override
public void commit() {
  checkTransactional();
  transactional.commit();
}
origin: apache/jena

@Override
public boolean containsNamedModel(String uri) {
  // Does not touch the cache.
  checkGraphName(uri) ;
  Node n = NodeFactory.createURI(uri) ;
  return dsg.containsGraph(n) ;
}
origin: SmartDataAnalytics/jena-sparql-api

public static FluentUpdateExecutionFactory from(DatasetGraph datasetGraph, Context context) {
  Dataset dataset = DatasetImpl.wrap(datasetGraph);
  FluentUpdateExecutionFactory result = from(dataset, context);
  return result;
}
origin: apache/jena

/**
 * Create a dataset, starting with the model argument as the default graph of the
 * dataset. Named graphs can be added. 
 * <p> 
 * Use {@link #wrap(Model)} to put dataset functionality around a single
 * model when named graphs will not be added.
 * 
 * @param model The model for the default graph
 * @return a dataset with the given model as the default graph
 */
public static Dataset create(Model model) {
  Objects.requireNonNull(model, "Default model must be provided") ;
  return new DatasetImpl(model);
}
origin: apache/jena

@Override
public void abort() {
  checkTransactional();
  transactional.abort();
}
origin: apache/jena

@Override
public Dataset addNamedModel(String uri, Model model) {
  checkGraphName(uri) ;
  Node n = NodeFactory.createURI(uri) ;
  dsg.addGraph(n, model.getGraph()) ;
  return this;
}
origin: SmartDataAnalytics/jena-sparql-api

public static FluentQueryExecutionFactory<?> from(DatasetGraph datasetGraph, Context context) {
  Dataset dataset = DatasetImpl.wrap(datasetGraph);
  return from(dataset, context);
}
origin: apache/jena

/**
 * @param dataset Dataset to clone structure from.
 * @return a dataset: clone the dataset structure of named graphs, and share the graphs themselves.
 * @deprecated This operation may be removed.
 */
@Deprecated
public static Dataset create(Dataset dataset) {
  Objects.requireNonNull(dataset, "Clone dataset is null") ;
  return new DatasetImpl(dataset);
}
origin: apache/jena

@Override
public void begin(ReadWrite mode) {
  checkTransactional();
  transactional.begin(mode);
}
origin: apache/jena

@Override
public Dataset replaceNamedModel(String uri, Model model) {
  // Assumes single writer.
  checkGraphName(uri) ;
  Node n = NodeFactory.createURI(uri) ;
  dsg.removeGraph(n) ;
  dsg.addGraph(n, model.getGraph() ) ;
  return this;
}
origin: ch.epfl.bluebrain.nexus.org.topbraid/shacl

  @Override
  public QueryIterator exec(Binding binding, PropFuncArg argSubject,
      Node predicate, PropFuncArg argObject, ExecutionContext execCxt) {

    argSubject = Substitute.substitute(argSubject, binding);
    argObject = Substitute.substitute(argObject, binding);
    
    if(!argObject.getArg().isVariable()) {
      throw new ExprEvalException("Right hand side of tosh:targetContains must be a variable");
    }
    
    Node targetNode = argSubject.getArgList().get(0);
    Node shapesGraphNode = argSubject.getArgList().get(1);
    
    Model currentModel = ModelFactory.createModelForGraph(execCxt.getActiveGraph());
    Dataset dataset = new DatasetWithDifferentDefaultModel(currentModel, DatasetImpl.wrap(execCxt.getDataset()));

    Model model = dataset.getNamedModel(shapesGraphNode.getURI());
    Resource target = (Resource) model.asRDFNode(targetNode);

    Set<Node> focusNodes = new HashSet<Node>();
    SHACLUtil.addNodesInTarget(target, dataset, focusNodes);
    return new QueryIterExtendByVar(binding, (Var) argObject.getArg(), focusNodes.iterator(), execCxt);
  }
}
origin: ch.epfl.bluebrain.nexus.org.topbraid/shacl

/**
 * Specifies a Dataset that shall be used for query execution.
 * Returns a new DatasetImpl by default but may be overloaded in subclasses.
 * For example, TopBraid delegates this to the currently open Graphs.
 * @param defaultModel  the default Model of the Dataset
 * @return the Dataset
 */
public Dataset getDataset(Model defaultModel) {
  if(defaultModel != null) {
    return new DatasetImpl(defaultModel);
  }
  else {
    return new DatasetImpl(JenaUtil.createMemoryModel());
  }
}

origin: apache/jena

@Override
public boolean promote(Promote txnType) {
  checkTransactional();
  return transactional.promote(txnType);
}
origin: TopQuadrant/shacl

  @Override
  public QueryIterator exec(Binding binding, PropFuncArg argSubject,
      Node predicate, PropFuncArg argObject, ExecutionContext execCxt) {

    argSubject = Substitute.substitute(argSubject, binding);
    argObject = Substitute.substitute(argObject, binding);
    
    if(!argObject.getArg().isVariable()) {
      throw new ExprEvalException("Right hand side of tosh:targetContains must be a variable");
    }
    
    Node targetNode = argSubject.getArgList().get(0);
    Node shapesGraphNode = argSubject.getArgList().get(1);
    
    Model currentModel = ModelFactory.createModelForGraph(execCxt.getActiveGraph());
    Dataset dataset = new DatasetWithDifferentDefaultModel(currentModel, DatasetImpl.wrap(execCxt.getDataset()));

    Model model = dataset.getNamedModel(shapesGraphNode.getURI());
    Resource target = (Resource) model.asRDFNode(targetNode);

    Set<Node> focusNodes = new HashSet<Node>();
    SHACLUtil.addNodesInTarget(target, dataset, focusNodes);
    return new QueryIterExtendByVar(binding, (Var) argObject.getArg(), focusNodes.iterator(), execCxt);
  }
}
org.apache.jena.sparql.coreDatasetImpl

Javadoc

An implementation of a Dataset. This is the "usual" implementation based on wrapping a DatasetGraph and providing an adapter layer from Model/Resource to Graph/Node The characteristics of this class depend on the characteristics of DatasetGraph.

Most used methods

  • <init>
  • wrap
  • checkGraphName
  • checkTransactional
  • graph2model
  • supportsTransactions

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • compareTo (BigDecimal)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Notification (javax.management)
  • JTextField (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 15 Vim Plugins
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