|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.soton.ecs.grimoires.server.impl.Jena
A class defining convenience functions to manipulate the Jena Triple store.
| Constructor Summary | |
Jena()
|
|
| Method Summary | |
static void |
addTripleIfObjectNotNull(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String propertyNS,
String propertyName,
Object object)
|
static void |
deleteEntity(com.hp.hpl.jena.rdf.model.Model readingModel,
ModelChanges changes,
Key key,
String keyRelationNS,
String keyRelationName)
Remove from the store an entity (with a given key) and all resources related to the entity. |
static void |
deleteResource(com.hp.hpl.jena.rdf.model.Model model,
ModelChanges changes,
com.hp.hpl.jena.rdf.model.Resource entity,
com.hp.hpl.jena.rdf.model.Property exclude,
com.hp.hpl.jena.rdf.model.Property fromBag)
Remove a resource and its descendents from the store model: RDF model to read from changes: the changes model entity: the resource of the entity to delete exclude: if not null, the resource refered to by this property will not be deleted fromBag: if both exclude and fromBag are not null, reference to the entity will be removed from fromBag |
static void |
deleteResource(com.hp.hpl.jena.rdf.model.Model model,
ModelChanges changes,
com.hp.hpl.jena.rdf.model.Resource entity,
String referenceType)
This function calculates the the property to exclude and the bag to delete from using the referenceType parameter. |
static Key |
ensureUniqueKey(com.hp.hpl.jena.rdf.model.Model readingModel,
ModelChanges changes,
Key key,
String keyRelationNS,
String keyRelation)
If the given key's value is null or empty (the way to specify addition in UDDIv2) then set the key's value to a newly generate string, if the key is not null or empty (the way to specify update in UDDIv2) then remove the existing entity with that key. |
static String |
generateRdqlQuery(GenerationResults conceptQuery)
|
static String |
generateRdqlQuery(SupportsRDQLQuery concept)
Should be removed when all APIs converted to using RDQLGenerator |
static com.hp.hpl.jena.rdf.model.Model |
getAttachedTree(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource parent,
String relationNamespace,
String relationName,
com.hp.hpl.jena.rdf.model.Resource root)
Return all statements the given resource is a subject or ancestor of, plus the relation attaching the root resource to its parent |
static com.hp.hpl.jena.rdf.model.RDFNode |
getBagElement(com.hp.hpl.jena.rdf.model.Bag from,
int index)
Returns the nth element of a bag or null if it does not exist. |
static com.hp.hpl.jena.rdf.model.Resource |
getKeyedResource(com.hp.hpl.jena.rdf.model.Model model,
String propertyNamespace,
String propertyName,
Key key)
Returns the resource with the given relation to a string literal. |
static String |
getResourceKey(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource resource,
String propertyNamespace,
String propertyName)
Returns the key for a resource representing a keyed resource. |
static com.hp.hpl.jena.rdf.model.Model |
getResourceTree(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource root)
Return all statements the given resource is a subject or ancestor of Recursive adds are done using getResourceBabyTree which handles cyclic relationship within the RDF model |
static com.hp.hpl.jena.rdf.model.Bag |
getUniqueBag(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String propertyNamespace,
String propertyName)
Same as getUniqueObject but used when the object should be a Bag. |
static com.hp.hpl.jena.rdf.model.RDFNode |
getUniqueObject(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property relation)
Used when a resource is expected to be the subject of one and only one relation of a given type, this convenience method returns the first object found, or null if none exist. |
static com.hp.hpl.jena.rdf.model.RDFNode |
getUniqueObject(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String propertyNamespace,
String propertyName)
Used when a resource is expected to be the subject of one and only one relation of a given type, this convenience method returns the first object found, or null if none exist. |
static boolean |
isType(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String typeNS,
String typeName)
|
static com.hp.hpl.jena.rdf.model.Bag |
newTypedBag(com.hp.hpl.jena.rdf.model.Model model,
String type)
Create a new Bag resource with an associated RDF type. |
static Vector |
processQuery(com.hp.hpl.jena.rdf.model.Model model,
GenerationResults rdqlQuery,
String variableName)
Create a new Bag resource with an associated RDF type and containing a list of Strings, where those Strings are gathered from the TextHolder objects given to this method. |
static Vector |
processQuery(com.hp.hpl.jena.rdf.model.Model m,
String rdqlQuery,
String variableName)
Returns a vector of resources matching variableName in rdqlQuery. |
static Vector |
processQuery(com.hp.hpl.jena.rdf.model.Model m,
String rdqlQuery,
String[] variableNames)
Returns a vector of resources matching variableName in rdqlQuery. |
static void |
setRDFType(com.hp.hpl.jena.rdf.model.Model m,
com.hp.hpl.jena.rdf.model.Resource r,
String resourceURI)
|
static void |
setRDFType(com.hp.hpl.jena.rdf.model.Resource r,
com.hp.hpl.jena.rdf.model.RDFNode typeResource)
|
static Hashtable |
usualNamespaces()
Should be removed when all APIs converted to using RDQLGenerator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Jena()
| Method Detail |
public static void addTripleIfObjectNotNull(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String propertyNS,
String propertyName,
Object object)
public static void deleteEntity(com.hp.hpl.jena.rdf.model.Model readingModel,
ModelChanges changes,
Key key,
String keyRelationNS,
String keyRelationName)
public static void deleteResource(com.hp.hpl.jena.rdf.model.Model model,
ModelChanges changes,
com.hp.hpl.jena.rdf.model.Resource entity,
com.hp.hpl.jena.rdf.model.Property exclude,
com.hp.hpl.jena.rdf.model.Property fromBag)
public static void deleteResource(com.hp.hpl.jena.rdf.model.Model model,
ModelChanges changes,
com.hp.hpl.jena.rdf.model.Resource entity,
String referenceType)
public static Key ensureUniqueKey(com.hp.hpl.jena.rdf.model.Model readingModel,
ModelChanges changes,
Key key,
String keyRelationNS,
String keyRelation)
public static com.hp.hpl.jena.rdf.model.Model getAttachedTree(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource parent,
String relationNamespace,
String relationName,
com.hp.hpl.jena.rdf.model.Resource root)
public static com.hp.hpl.jena.rdf.model.RDFNode getBagElement(com.hp.hpl.jena.rdf.model.Bag from,
int index)
public static com.hp.hpl.jena.rdf.model.Resource getKeyedResource(com.hp.hpl.jena.rdf.model.Model model,
String propertyNamespace,
String propertyName,
Key key)
public static String getResourceKey(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource resource,
String propertyNamespace,
String propertyName)
throws StoreException
StoreException
public static com.hp.hpl.jena.rdf.model.Model getResourceTree(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource root)
public static com.hp.hpl.jena.rdf.model.Bag getUniqueBag(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String propertyNamespace,
String propertyName)
public static com.hp.hpl.jena.rdf.model.RDFNode getUniqueObject(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property relation)
public static com.hp.hpl.jena.rdf.model.RDFNode getUniqueObject(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String propertyNamespace,
String propertyName)
public static boolean isType(com.hp.hpl.jena.rdf.model.Model model,
com.hp.hpl.jena.rdf.model.Resource subject,
String typeNS,
String typeName)
public static final com.hp.hpl.jena.rdf.model.Bag newTypedBag(com.hp.hpl.jena.rdf.model.Model model,
String type)
throws com.hp.hpl.jena.rdf.model.RDFException
com.hp.hpl.jena.rdf.model.RDFException
public static Vector processQuery(com.hp.hpl.jena.rdf.model.Model model,
GenerationResults rdqlQuery,
String variableName)
public static Vector processQuery(com.hp.hpl.jena.rdf.model.Model m,
String rdqlQuery,
String variableName)
public static Vector processQuery(com.hp.hpl.jena.rdf.model.Model m,
String rdqlQuery,
String[] variableNames)
public static final void setRDFType(com.hp.hpl.jena.rdf.model.Model m,
com.hp.hpl.jena.rdf.model.Resource r,
String resourceURI)
throws com.hp.hpl.jena.rdf.model.RDFException
com.hp.hpl.jena.rdf.model.RDFException
public static final void setRDFType(com.hp.hpl.jena.rdf.model.Resource r,
com.hp.hpl.jena.rdf.model.RDFNode typeResource)
throws com.hp.hpl.jena.rdf.model.RDFException
com.hp.hpl.jena.rdf.model.RDFExceptionpublic static String generateRdqlQuery(SupportsRDQLQuery concept)
public static String generateRdqlQuery(GenerationResults conceptQuery)
public static Hashtable usualNamespaces()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||