uk.ac.soton.ecs.grimoires.server.impl.metadata.handlers
Class MetadataUtilities

java.lang.Object
  extended byuk.ac.soton.ecs.grimoires.server.impl.metadata.handlers.MetadataUtilities

public class MetadataUtilities
extends Object


Field Summary
static String MetadataHolderVariableName
           
static String MetadataValueVariableName
           
 
Constructor Summary
MetadataUtilities()
           
 
Method Summary
static com.hp.hpl.jena.rdf.model.RDFNode attachMetadata(com.hp.hpl.jena.rdf.model.Model readingModel, ModelChanges changes, com.hp.hpl.jena.rdf.model.Resource attachedTo, Metadata newMetadata)
          Attach a piece of metadata to a resource.
static Collection findAnnotatedResources(com.hp.hpl.jena.rdf.model.Model model, MetadataQueryBag queryBag)
           
static Collection getAnnotatedResources(com.hp.hpl.jena.rdf.model.Model model, com.hp.hpl.jena.rdf.model.Resource entity)
          Returns a list of metadata resources attached to a given entity
static com.hp.hpl.jena.rdf.model.Resource getEntityReferenceResource(com.hp.hpl.jena.rdf.model.Model model, EntityReference ref)
          Return the resource referred to by the entityReference or null if it doesn't exist supported entityReferences are: businessKey, serviceKey, tModelKey, bindingKey, messagePartReference and operationReference
static com.hp.hpl.jena.rdf.model.Resource getMetadata(com.hp.hpl.jena.rdf.model.Model model, String key)
          Returns the metadata resource with the given key, or null if there is none.
static String getMetadataKey(com.hp.hpl.jena.rdf.model.Model model, com.hp.hpl.jena.rdf.model.Resource metadataResource)
          Returns the key of the given metadata resource.
static String getWsdlUriFromMessagePart(com.hp.hpl.jena.rdf.model.Model model, com.hp.hpl.jena.rdf.model.Resource messagePartResource)
          This function trasverses the RDF graph to find the name of the WSDL file that the messagePartResource is a part of.
static String getWsdlUriFromOperation(com.hp.hpl.jena.rdf.model.Model model, com.hp.hpl.jena.rdf.model.Resource operationResource)
          This function trasverses the RDF graph to find the name of the WSDL file that the operationResource is a part of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MetadataHolderVariableName

public static String MetadataHolderVariableName

MetadataValueVariableName

public static String MetadataValueVariableName
Constructor Detail

MetadataUtilities

public MetadataUtilities()
Method Detail

attachMetadata

public static com.hp.hpl.jena.rdf.model.RDFNode attachMetadata(com.hp.hpl.jena.rdf.model.Model readingModel,
                                                               ModelChanges changes,
                                                               com.hp.hpl.jena.rdf.model.Resource attachedTo,
                                                               Metadata newMetadata)
                                                        throws com.hp.hpl.jena.rdf.model.RDFException,
                                                               StoreException
Attach a piece of metadata to a resource. The changes are recorded in a ModelChanges object to later be committed into the main model. A side effect of the metadata serialisation is to set the date.

Assumes a read or write lock has been obtained for the model before calling.

Parameters:
changes - The running record of triples to add or remove
attachedTo - The resource the metadata should be attached to.
newMetadata - The metadata item to be attached
Returns:
the RDFNode where the new metadata is stored
Throws:
com.hp.hpl.jena.rdf.model.RDFException
StoreException

findAnnotatedResources

public static Collection findAnnotatedResources(com.hp.hpl.jena.rdf.model.Model model,
                                                MetadataQueryBag queryBag)

getAnnotatedResources

public static Collection getAnnotatedResources(com.hp.hpl.jena.rdf.model.Model model,
                                               com.hp.hpl.jena.rdf.model.Resource entity)
Returns a list of metadata resources attached to a given entity


getMetadata

public static com.hp.hpl.jena.rdf.model.Resource getMetadata(com.hp.hpl.jena.rdf.model.Model model,
                                                             String key)
Returns the metadata resource with the given key, or null if there is none.


getMetadataKey

public static String getMetadataKey(com.hp.hpl.jena.rdf.model.Model model,
                                    com.hp.hpl.jena.rdf.model.Resource metadataResource)
                             throws StoreException
Returns the key of the given metadata resource.

Throws:
StoreException

getEntityReferenceResource

public static com.hp.hpl.jena.rdf.model.Resource getEntityReferenceResource(com.hp.hpl.jena.rdf.model.Model model,
                                                                            EntityReference ref)
Return the resource referred to by the entityReference or null if it doesn't exist supported entityReferences are: businessKey, serviceKey, tModelKey, bindingKey, messagePartReference and operationReference


getWsdlUriFromOperation

public static String getWsdlUriFromOperation(com.hp.hpl.jena.rdf.model.Model model,
                                             com.hp.hpl.jena.rdf.model.Resource operationResource)
                                      throws StoreException
This function trasverses the RDF graph to find the name of the WSDL file that the operationResource is a part of. On success, the URI filename is returned. On failure a StoreException is thrown

Throws:
StoreException

getWsdlUriFromMessagePart

public static String getWsdlUriFromMessagePart(com.hp.hpl.jena.rdf.model.Model model,
                                               com.hp.hpl.jena.rdf.model.Resource messagePartResource)
                                        throws StoreException
This function trasverses the RDF graph to find the name of the WSDL file that the messagePartResource is a part of. On success, the URI filename is returned. On failure a StoreException is thrown

Throws:
StoreException