Class ResourceInDatasetImpl

java.lang.Object
org.apache.jena.enhanced.Polymorphic<org.apache.jena.rdf.model.RDFNode>
org.apache.jena.enhanced.EnhNode
org.apache.jena.rdf.model.impl.ResourceImpl
org.aksw.jenax.arq.dataset.impl.ResourceInDatasetImpl
All Implemented Interfaces:
RDFNodeInDataset, ResourceInDataset, org.apache.jena.graph.FrontsNode, org.apache.jena.rdf.model.RDFNode, org.apache.jena.rdf.model.Resource

public class ResourceInDatasetImpl extends org.apache.jena.rdf.model.impl.ResourceImpl implements ResourceInDataset
A specific resource in the default graph or one of the named graphs of a dataset. Note, that resources obtained via .as(viewClass) will retain the reference to the dataset's model, but the reference to the dataset itself will be lost
Author:
raven
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.jena.query.Dataset
     
    protected String
     

    Fields inherited from class org.apache.jena.rdf.model.impl.ResourceImpl

    factory, rdfNodeFactory

    Fields inherited from class org.apache.jena.enhanced.EnhNode

    enhGraph, node
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResourceInDatasetImpl(org.apache.jena.query.Dataset dataset, String graphName, org.apache.jena.graph.Node node)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    applyNodeTransform(ResourceInDataset old, org.apache.jena.sparql.graph.NodeTransform nodeTransform)
    Rename multiple RDFterms
     
     
    Create a new ResourceInDataset instance backed by a blank node in the default graph.
    createFromCopy(org.apache.jena.query.Dataset tgt, String graphName, org.apache.jena.rdf.model.Resource src)
     
    createFromCopyIntoDefaultGraph(org.apache.jena.rdf.model.Resource r)
    Copy the content of a given resource's model into this resource's dataset and return an ResourceInDataset instance for it.
    createFromCopyIntoResourceGraph(org.apache.jena.rdf.model.Resource r)
     
    createInDefaultGraph(org.apache.jena.graph.Node node)
     
    org.apache.jena.query.Dataset
     
    The named graph such that r.getDataset().getNamedGraph(r.getGraphName()).equals(r.getModel()) While the model and possibly graph instances may not be reference equal due to being different views, they should still operate on the same underlying collection of triples.
    inDataset(org.apache.jena.query.Dataset other)
     
    static void
    main(String[] args)
     
     
     
    selectByProperty(org.apache.jena.query.Dataset dataset, org.apache.jena.rdf.model.Property p)
     

    Methods inherited from class org.apache.jena.rdf.model.impl.ResourceImpl

    abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, asStatementTerm, begin, commit, getId, getLocalName, getModel, getModelCom, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, mustHaveModel, removeAll, removeProperties, toString, visitWith

    Methods inherited from class org.apache.jena.enhanced.EnhNode

    as, asNode, canAs, canSupport, convertTo, equals, getGraph, getPersonality, hashCode, isAnon, isLiteral, isResource, isStatementTerm, isURIResource, isValid, viewAs

    Methods inherited from class org.apache.jena.enhanced.Polymorphic

    addView, alreadyHasView, asInternal, supports

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.jena.graph.FrontsNode

    asNode

    Methods inherited from interface org.apache.jena.rdf.model.RDFNode

    as, asStatementTerm, canAs, getModel, isAnon, isLiteral, isResource, isStatementTerm, isURIResource, visitWith

    Methods inherited from interface org.aksw.jenax.arq.dataset.api.RDFNodeInDataset

    asRDFNodeInDatasetHere, mutateRDFNode

    Methods inherited from interface org.apache.jena.rdf.model.Resource

    abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString

    Methods inherited from interface org.aksw.jenax.arq.dataset.api.ResourceInDataset

    mutateResource
  • Field Details

    • dataset

      protected org.apache.jena.query.Dataset dataset
    • graphName

      protected String graphName
  • Constructor Details

    • ResourceInDatasetImpl

      public ResourceInDatasetImpl(org.apache.jena.query.Dataset dataset, String graphName, org.apache.jena.graph.Node node)
  • Method Details

    • main

      public static void main(String[] args)
    • selectByProperty

      public static List<ResourceInDataset> selectByProperty(org.apache.jena.query.Dataset dataset, org.apache.jena.rdf.model.Property p)
    • applyNodeTransform

      public static ResourceInDataset applyNodeTransform(ResourceInDataset old, org.apache.jena.sparql.graph.NodeTransform nodeTransform)
      Rename multiple RDFterms
      Parameters:
      old -
      renames -
      Returns:
    • renameResource

      public static ResourceInDataset renameResource(ResourceInDataset old, String uri)
    • renameGraph

      public static ResourceInDataset renameGraph(ResourceInDataset r, String tgtGraphName)
    • createAnonInDefaultGraph

      public static ResourceInDataset createAnonInDefaultGraph()
      Create a new ResourceInDataset instance backed by a blank node in the default graph.
    • createFromCopyIntoDefaultGraph

      public static ResourceInDataset createFromCopyIntoDefaultGraph(org.apache.jena.rdf.model.Resource r)
      Copy the content of a given resource's model into this resource's dataset and return an ResourceInDataset instance for it.
      Parameters:
      r -
    • createInDefaultGraph

      public static ResourceInDataset createInDefaultGraph(org.apache.jena.graph.Node node)
    • createFromCopyIntoResourceGraph

      public static ResourceInDataset createFromCopyIntoResourceGraph(org.apache.jena.rdf.model.Resource r)
    • createFromCopy

      public static ResourceInDataset createFromCopy(org.apache.jena.query.Dataset tgt, String graphName, org.apache.jena.rdf.model.Resource src)
    • getGraphName

      public String getGraphName()
      Description copied from interface: RDFNodeInDataset
      The named graph such that r.getDataset().getNamedGraph(r.getGraphName()).equals(r.getModel()) While the model and possibly graph instances may not be reference equal due to being different views, they should still operate on the same underlying collection of triples.
      Specified by:
      getGraphName in interface RDFNodeInDataset
      Returns:
    • getDataset

      public org.apache.jena.query.Dataset getDataset()
      Specified by:
      getDataset in interface RDFNodeInDataset
    • asResource

      public ResourceInDatasetImpl asResource()
      Specified by:
      asResource in interface org.apache.jena.rdf.model.RDFNode
      Specified by:
      asResource in interface RDFNodeInDataset
      Specified by:
      asResource in interface ResourceInDataset
      Overrides:
      asResource in class org.apache.jena.rdf.model.impl.ResourceImpl
    • inDataset

      public ResourceInDataset inDataset(org.apache.jena.query.Dataset other)
      Specified by:
      inDataset in interface RDFNodeInDataset
      Specified by:
      inDataset in interface ResourceInDataset
    • asLiteral

      public LiteralInDataset asLiteral()
      Specified by:
      asLiteral in interface org.apache.jena.rdf.model.RDFNode
      Specified by:
      asLiteral in interface RDFNodeInDataset
      Overrides:
      asLiteral in class org.apache.jena.rdf.model.impl.ResourceImpl