public class GPO extends Object implements IGPO
Constructor and Description |
---|
GPO(IObjectManager om,
org.openrdf.model.BNode id,
org.openrdf.model.Statement stmt) |
GPO(IObjectManager om,
org.openrdf.model.Resource id) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(org.openrdf.model.URI property,
org.openrdf.model.Value value)
Assert (self,p,newValue).
|
IGenericSkin |
asClass(Class theClassOrInterface)
Returns an transient object that wraps the same persistent object but
exposes the behavior identified by the identified interface.
|
IGPO |
asGeneric()
|
void |
dematerialize() |
void |
doCommit()
Called by the ObjectManager when flushing dirty objects.
|
String |
encode(org.openrdf.model.Resource v)
Encode a URL, Literal, or blank node for inclusion in a SPARQL query to
be sent to the remote service.
|
BigdataResource |
getId()
Returns the persistent identity of the generic object.
|
IGPO |
getLink(org.openrdf.model.URI property,
IGPO target)
Return the
IGPO modeling the link iff it exists. |
Set<IGPO> |
getLinksIn()
getLinksIn simply filters the values for Resources and returns a wrapper.
|
ILinkSet |
getLinksIn(org.openrdf.model.URI property)
All ?y where (?y,p,self).
|
Set<IGPO> |
getLinksOut()
All ?y where (self,?,?y).
|
ILinkSet |
getLinksOut(org.openrdf.model.URI property)
All ?y where (self,p,?y).
|
IObjectManager |
getObjectManager()
Return the
IObjectManager used to materialize or create this
generic object. |
Iterator<org.openrdf.model.URI> |
getPropertyURIs() |
Map<org.openrdf.model.URI,Long> |
getReverseLinkProperties()
Return a map giving the range count for each reverse link property.
|
IGenericSkin |
getSkin(Class intf)
The getSkin method is inspired somewhat by the Microsoft Win32
getInterface that allowed an object to return multiple interfaces.
|
BigdataStatement |
getStatement()
Iff this
IGPO represents a statement (aka link), then return that
Statement . |
Set<org.openrdf.model.Statement> |
getStatements()
All (self,?p,?o).
|
IGPO |
getType()
FIXME: this method will be moved to an as yet unnamed derived class
that will become the superclass for alchemist generated subclasses.
|
org.openrdf.model.Value |
getValue(org.openrdf.model.URI property)
Return first Value for property or null if no Value for that property.
|
Set<org.openrdf.model.Value> |
getValues(org.openrdf.model.URI property)
All ?y where (self,p,?y).
|
int |
hashCode()
Return the hash code of the identity of the generic object.
|
void |
initLinkValue(org.openrdf.model.URI predicate,
org.openrdf.model.Resource object) |
void |
initValue(org.openrdf.model.URI predicate,
org.openrdf.model.Value object) |
boolean |
isBound(org.openrdf.model.URI property)
Exists (self,p,?y).
|
boolean |
isDirty() |
boolean |
isMemberOf(ILinkSet linkSet)
Exists (?x,linkSet.property,self).
|
IGPO |
materialize()
Basis for lazy materialization, checks materialize state and if false
requests matierialization from the ObjectManager
|
String |
pp() |
void |
prepareBatchUpdate(List<org.openrdf.model.Statement> insertList,
List<org.openrdf.model.Statement> removeList)
Adds statements to be inserted and removed to the appropriate lists based
on the
GPO s internal edit set. |
void |
remove()
FIXME This should run a query (unless it is fully materialized, including
the reverse links and forward links) and build an edit list for the
retracts.
|
void |
removeValue(org.openrdf.model.URI property,
org.openrdf.model.Value value)
Remove (self,p,oldValue) if found.
|
void |
removeValues(org.openrdf.model.URI property)
Remove all (self,p,?).
|
void |
setMaterialized(boolean b) |
void |
setValue(org.openrdf.model.URI property,
org.openrdf.model.Value newValue)
Replace (self,p,?x) with (self,p,newValue).
|
public GPO(IObjectManager om, org.openrdf.model.Resource id)
public GPO(IObjectManager om, org.openrdf.model.BNode id, org.openrdf.model.Statement stmt)
public void dematerialize()
public int hashCode()
IGPO
public IGenericSkin asClass(Class theClassOrInterface)
IGPO
IGenericSkin
has already been minted for this generic object, then it is simply
returned. Otherwise an implementation class for the interface MUST have
been registered with the runtime and MUST implement a constructor
accepting a single IGenericSkin
argument.
The life cycle of a skin object returned by this method MUST be no less than the in-memory life cycle of the generic object for which the skin was minted. This constraint makes it possible to have transient yet expensive initialization, such as caches, on skin objects.
asClass
in interface IGPO
IGenericSkin
,
GenericSkinRegistry
public IObjectManager getObjectManager()
IGPO
IObjectManager
used to materialize or create this
generic object.getObjectManager
in interface IGPO
public BigdataResource getId()
IGPO
public BigdataStatement getStatement()
IGPO
represents a statement (aka link), then return that
Statement
.Statement
or null
if the IGPO
does not represent a Statement
.public String encode(org.openrdf.model.Resource v)
v
- The resource.ObjectMgrModel.encode(Resource)
public Set<IGPO> getLinksIn()
getLinksIn
in interface IGPO
public ILinkSet getLinksIn(org.openrdf.model.URI property)
getLinksIn
in interface IGPO
public Set<IGPO> getLinksOut()
getLinksOut
in interface IGPO
public ILinkSet getLinksOut(org.openrdf.model.URI property)
getLinksOut
in interface IGPO
public Map<org.openrdf.model.URI,Long> getReverseLinkProperties()
IGPO
SELECT ?p, COUNT(*) WHERE { ?o ?p} GROUP BY ?p
getReverseLinkProperties
in interface IGPO
public Set<org.openrdf.model.Statement> getStatements()
IGPO
getStatements
in interface IGPO
public org.openrdf.model.Value getValue(org.openrdf.model.URI property)
IGPO
public Set<org.openrdf.model.Value> getValues(org.openrdf.model.URI property)
IGPO
public boolean isBound(org.openrdf.model.URI property)
IGPO
public boolean isMemberOf(ILinkSet linkSet)
IGPO
isMemberOf
in interface IGPO
public void remove()
public void initValue(org.openrdf.model.URI predicate, org.openrdf.model.Value object)
public void initLinkValue(org.openrdf.model.URI predicate, org.openrdf.model.Resource object)
public void setValue(org.openrdf.model.URI property, org.openrdf.model.Value newValue)
IGPO
public IGPO getLink(org.openrdf.model.URI property, IGPO target)
IGPO
modeling the link iff it exists.
FIXME This should be conditional, returning null if the link does not
exist. However, that conditional test needs to be efficient.public void addValue(org.openrdf.model.URI property, org.openrdf.model.Value value)
IGPO
public void removeValue(org.openrdf.model.URI property, org.openrdf.model.Value value)
IGPO
removeValue
in interface IGPO
public void removeValues(org.openrdf.model.URI property)
IGPO
removeValues
in interface IGPO
public boolean isDirty()
public IGPO asGeneric()
IGenericSkin
IGPO
interface and is primarily used to peel off a
skin and gain access to implementation specific methods on the
IGPO
implementation object. When invoked on an
object that directly implements the IGPO
behavior
(vs delegating the interface to an implementation object), then
that object is returned. The return value is never
null
.asGeneric
in interface IGenericSkin
public String pp()
public IGPO getType()
IGPO
public void doCommit()
public IGPO materialize()
materialize
in interface IGPO
IGPO
.public void setMaterialized(boolean b)
public void prepareBatchUpdate(List<org.openrdf.model.Statement> insertList, List<org.openrdf.model.Statement> removeList)
GPO
s internal edit set.insertList
- The list of statements to be added.removeList
- The list of statements to be removed.public IGenericSkin getSkin(Class intf)
It may be worthwhile performance wise to cache a skin. I believe of more importance is to preserve identity - even of the interface/skin object.
skin
- interface requiredpublic Iterator<org.openrdf.model.URI> getPropertyURIs()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.