public abstract class OREResourceJena extends Object implements OREResource, GraphResource
Modifier and Type | Field and Description |
---|---|
protected com.hp.hpl.jena.rdf.model.Model |
model |
protected com.hp.hpl.jena.rdf.model.Resource |
res |
Modifier | Constructor and Description |
---|---|
protected |
OREResourceJena() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
aboveInHierarchy(Vocab type) |
void |
addAgent(URI relationship,
Agent agent) |
void |
addCreator(Agent creator) |
protected void |
addModelToModel(com.hp.hpl.jena.rdf.model.Model externalModel) |
void |
addRDF(String rdf,
String format) |
protected void |
addResourceToModel(com.hp.hpl.jena.rdf.model.Resource resource) |
void |
addTriple(Triple triple)
Add the given triple to the current graph.
|
void |
addTriples(List<Triple> triples)
Add the list of triples to the current graph.
|
void |
addType(URI type)
Add the given type URI to the resource
|
void |
clearAgents(URI relationship) |
void |
clearCreators() |
void |
clearTypes()
Remove all the types associated with this resource.
|
Triple |
createTriple(Predicate pred,
Object literal)
Create a triple with the given predicate on the given literal.
|
Triple |
createTriple(Predicate pred,
URI uri)
Create a triple with the given predicate on the given URI
|
Triple |
createTriple(URI pred,
Object literal)
Create a triple using the given URI for the predicate and the given
literal for the subject.
|
Triple |
createTriple(URI pred,
URI uri)
Create a triple using the given URI for the predicate and the given
URI for the subject.
|
Triple |
createTriple(Vocab pred,
Object literal)
Create a triple using the given Vocab enum element as the source of the
prdicate, and the given Object as a literal.
|
Triple |
createTriple(Vocab pred,
URI uri)
Create a triple using the given Vocab enum element as the source of the
predicate, and the given URI for the subject.
|
abstract void |
detach()
Detach the current object from the current model.
|
abstract void |
empty()
Remove everyting inside the object, but leave the object itself
in existence.
|
List<Agent> |
getAgents(URI relationship) |
List<Agent> |
getCreators() |
com.hp.hpl.jena.rdf.model.Model |
getModel() |
protected List<Vocab> |
getOREObjectOfPredicates(com.hp.hpl.jena.rdf.model.Resource resource) |
protected List<Vocab> |
getORESubjectOfPredicates(com.hp.hpl.jena.rdf.model.Resource resource) |
protected Vocab |
getOREType(com.hp.hpl.jena.rdf.model.Resource resource) |
com.hp.hpl.jena.rdf.model.Resource |
getResource() |
List<URI> |
getTypes()
Get a list of the types associated with this resource.
|
URI |
getURI()
Get the URI representing the resource
|
protected boolean |
isUsedElsewhere(com.hp.hpl.jena.rdf.model.Resource resource) |
List<Triple> |
listAllTriples()
List all triples associated with the whole ORE graph as known about by
the resource in its current environment.
|
List<Triple> |
listAllTriples(TripleSelector selector)
List all triples associated with the whole ORE graph as known about by
the resource in its current environment, which match the selection
criteria
|
List<Triple> |
listTriples()
List all of the triples directly descended from the resource type.
|
List<Triple> |
listTriples(TripleSelector selector)
List all the triples directly descended from the resource type which match
the selection criteria.
|
protected List<Triple> |
listTriples(URI subjectURI,
Predicate predInit,
URI objectURI,
Object objectLiteral) |
protected void |
prune() |
protected boolean |
recursivelyRemovable(com.hp.hpl.jena.rdf.model.Statement stmt) |
protected void |
recursiveRemove(com.hp.hpl.jena.rdf.model.Resource resource) |
void |
removeTriple(Triple triple)
Remove the given triple from the current graph.
|
void |
setAgents(List<URI> relationship,
Agent agent) |
void |
setCreators(List<Agent> creators) |
void |
setModel(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.AnonId blankID) |
void |
setModel(com.hp.hpl.jena.rdf.model.Model model,
URI resourceURI) |
void |
setResource(com.hp.hpl.jena.rdf.model.Resource resource) |
void |
setTypes(List<URI> types)
Set the list of types associated with this resource.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOREType
protected com.hp.hpl.jena.rdf.model.Model model
protected com.hp.hpl.jena.rdf.model.Resource res
public URI getURI() throws OREException
OREResource
getURI
in interface OREResource
null
if not.OREException
public List<Triple> listTriples() throws OREException
OREResource
listTriples
in interface OREResource
OREException
public List<Triple> listAllTriples() throws OREException
OREResource
listAllTriples
in interface OREResource
OREException
public List<Triple> listTriples(TripleSelector selector) throws OREException
OREResource
listTriples
in interface OREResource
OREException
public List<Triple> listAllTriples(TripleSelector selector) throws OREException
OREResource
listAllTriples
in interface OREResource
OREException
public void addTriples(List<Triple> triples) throws OREException
OREResource
addTriples
in interface OREResource
OREException
public void addTriple(Triple triple) throws OREException
OREResource
addTriple
in interface OREResource
OREException
public void removeTriple(Triple triple) throws OREException
OREResource
removeTriple
in interface OREResource
OREException
public Triple createTriple(Predicate pred, URI uri) throws OREException
OREResource
createTriple
in interface OREResource
OREException
public Triple createTriple(Predicate pred, Object literal) throws OREException
OREResource
.toString()
method or another method
as per the implementation.createTriple
in interface OREResource
OREException
public Triple createTriple(URI pred, URI uri) throws OREException
OREResource
createTriple
in interface OREResource
OREException
public Triple createTriple(URI pred, Object literal) throws OREException
OREResource
createTriple
in interface OREResource
OREException
public Triple createTriple(Vocab pred, URI uri) throws OREException
OREResource
createTriple
in interface OREResource
OREException
public Triple createTriple(Vocab pred, Object literal) throws OREException
OREResource
createTriple
in interface OREResource
OREException
public List<Agent> getCreators()
getCreators
in interface OREResource
public void setCreators(List<Agent> creators)
setCreators
in interface OREResource
public void addCreator(Agent creator)
addCreator
in interface OREResource
public void clearCreators()
clearCreators
in interface OREResource
public List<Agent> getAgents(URI relationship) throws OREException
getAgents
in interface OREResource
OREException
public void setAgents(List<URI> relationship, Agent agent) throws OREException
setAgents
in interface OREResource
OREException
public void addAgent(URI relationship, Agent agent) throws OREException
addAgent
in interface OREResource
OREException
public void clearAgents(URI relationship) throws OREException
clearAgents
in interface OREResource
OREException
public List<URI> getTypes() throws OREException
OREResource
getTypes
in interface OREResource
OREException
public void setTypes(List<URI> types)
OREResource
setTypes
in interface OREResource
public void addType(URI type)
OREResource
addType
in interface OREResource
public void clearTypes()
OREResource
clearTypes
in interface OREResource
public void addRDF(String rdf, String format) throws OREException
addRDF
in interface OREResource
OREException
public abstract void empty() throws OREException
OREResource
empty
in interface OREResource
OREException
public abstract void detach() throws OREException
OREResource
detach
in interface OREResource
OREException
public com.hp.hpl.jena.rdf.model.Resource getResource()
getResource
in interface GraphResource
public void setResource(com.hp.hpl.jena.rdf.model.Resource resource)
setResource
in interface GraphResource
public com.hp.hpl.jena.rdf.model.Model getModel()
getModel
in interface GraphResource
public void setModel(com.hp.hpl.jena.rdf.model.Model model, URI resourceURI) throws OREException
setModel
in interface GraphResource
OREException
public void setModel(com.hp.hpl.jena.rdf.model.Model model, com.hp.hpl.jena.rdf.model.AnonId blankID) throws OREException
setModel
in interface GraphResource
OREException
protected List<Triple> listTriples(URI subjectURI, Predicate predInit, URI objectURI, Object objectLiteral) throws OREException
OREException
protected void addResourceToModel(com.hp.hpl.jena.rdf.model.Resource resource)
protected void addModelToModel(com.hp.hpl.jena.rdf.model.Model externalModel)
protected void recursiveRemove(com.hp.hpl.jena.rdf.model.Resource resource) throws OREException
OREException
protected boolean recursivelyRemovable(com.hp.hpl.jena.rdf.model.Statement stmt) throws OREException
OREException
protected Vocab getOREType(com.hp.hpl.jena.rdf.model.Resource resource) throws OREException
OREException
protected boolean aboveInHierarchy(Vocab type) throws OREException
OREException
protected boolean isUsedElsewhere(com.hp.hpl.jena.rdf.model.Resource resource) throws OREException
OREException
protected void prune()
protected List<Vocab> getOREObjectOfPredicates(com.hp.hpl.jena.rdf.model.Resource resource)
Copyright © 2020. All rights reserved.