Codota Logo
DatasetImpl
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
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 void abort() {
  checkTransactional();
  transactional.abort();
}
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: 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 Dataset removeNamedModel(String uri) {
  checkGraphName(uri) ;
  Node n = NodeFactory.createURI(uri) ;
  dsg.removeGraph(n) ;
  return this;
}
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 ReadWrite transactionMode() {
  checkTransactional();
  return transactional.transactionMode();
}
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 boolean promote(Promote txnType) {
  checkTransactional();
  return transactional.promote(txnType);
}
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 void begin(ReadWrite mode) {
  checkTransactional();
  transactional.begin(mode);
}
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

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
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