org.openrdf.sesame.server.soap
Class SoapClient

java.lang.Object
  extended byorg.openrdf.sesame.server.soap.SoapClient

public class SoapClient
extends Object


Constructor Summary
SoapClient(String ServerUrl, String ServiceName)
          The only constructor of the SOAP client.
 
Method Summary
 int addDataFromUrl(String dataUrl, String baseURL)
          Upload a RDF(S) data located on the NET using it's URI into the currently selected repository.
 String branchState(String stateUID)
          branch the repository at given state for further operations.
 boolean clearRepository()
          Clear the contents of the current repository.
 void continueCounterIncrement()
          Coninue with the normal increment of the update counter on each modification made in the repository.
 Vector evalRdqlQuery(String query)
          Evaluate an RDQL query over the data held in the current repository
 Vector evalRqlQuery(String query)
          Evaluate an RQL query over the data held in the current repository
 String extractRDF(boolean ontology, boolean instances, boolean explicit)
          Etract the contents of the current repository as RDF.
 Vector getClasses()
          Retrive a list of the defined classes in the repository
 Vector getClassesOf(String anInstance, boolean mostSpecific)
          Retrive a list of classes to which an Instance belongs
 Vector getInstancesOf(String aClass, boolean proper)
          Retrive a list of URI's of an instances about specific class
 Map getMetaInfo(String subj, String pred, String obj)
           
 Vector getProperties()
          Retrive a list of the defined properties in the repository
 String getRepositoryTitle(String repositoryId)
           
 Vector getStatements(String subj, String pred, String obj, boolean explicitOnly, boolean objIsLiteral)
          Retrive a list of the statemnets from the repository.
 Vector getSubClassesOf(String resource, boolean direct)
          Retrieve a list of the subclasses of a class
 Vector getSubPropertiesOf(String resource, boolean direct)
          Retrieve a list of the subproperties of a property
 Vector getSuperClassesOf(String resource, boolean direct)
          Retrieve a list of the superclasses of a class
 Vector getSuperPropertiesOf(String resource, boolean direct)
          Retrieve a list of the superproperties of a property
 Vector getUpdateIds()
          Retrive list of all Updates of the repository.
 Map getUpdateMetaInfo(String updateId)
           
 Vector getVersionIds()
           
 Map getVersionMetaInfo(String versionId)
           
 Vector getVersions()
          Retrive list of all labeled states of the repository.
 boolean hasStatement(String subj, String pred, String obj, boolean explicitOnly, boolean objIsLiteral)
          Query the repository for particular statement
 boolean isClass(String resource)
          Check that a URI is a class
 boolean isInstanceOf(String anInstance, String aClass, boolean proper)
          Check that a URI is an instance of a class
 boolean isPausedCounterIncrement()
          Check if the update couter ss paused
 boolean isProperty(String resource)
          Check that a URI is a property
 boolean isSubClassOf(String subClass, String superClass, boolean direct)
          Query for subsumtion of two classes
 boolean isSubPropertyOf(String subProperty, String superProperty, boolean direct)
          Query for subsumtion of two properties
 void labelCurrentState(String label)
          Create a labeled version of the curent repository state.
 void labelState(String stateUID, String label)
          Create a labeled version for a statte of the repository assigning the necessary mata-information about thet operation.
 String[] listRepositories()
          Retrieve a list of availibe repositories on the server
 boolean login(String userID, String pass)
          Login to server.
 void pauseCounterIncrement()
          Stop the increment of the update counter.
 int removeStatements(String subjURI, String predURI, String objURI, boolean bObjectIsLiteral)
          remove statements from the repository
 void revertToState(String stateUID)
          Restore the repository to previous state removing all statements added after the value of the update counter and revive all remover ones.
 boolean selectRepository(String repos)
          Select a repository to work with
 int uploadData(String data, String baseURL)
          Upload RDF(S) data to current repository
 void workWithState(String stateUID)
          Sets the repository to given state for further read operations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapClient

public SoapClient(String ServerUrl,
                  String ServiceName)
           throws MalformedURLException
The only constructor of the SOAP client.

Parameters:
ServerUrl - the URL of the SOAP rpcrouter server
ServiceName - the ID of the SOAP service to use
Method Detail

listRepositories

public String[] listRepositories()
Retrieve a list of availibe repositories on the server

Returns:
an array of repository ID's

getRepositoryTitle

public String getRepositoryTitle(String repositoryId)

selectRepository

public boolean selectRepository(String repos)
Select a repository to work with

Parameters:
repos - repository ID.
Returns:
true if successful

login

public boolean login(String userID,
                     String pass)
Login to server.

Parameters:
userID - user ID
pass - user password
Returns:
true if successful

addDataFromUrl

public int addDataFromUrl(String dataUrl,
                          String baseURL)
Upload a RDF(S) data located on the NET using it's URI into the currently selected repository.

Parameters:
dataUrl - the URL to the RDF(S)data.
baseURL - URI that should be used as namespace for those resources, found in the data, that do not have an explicitly defined one. This parameter can be eiter null or empty string in ehich case the URL to the date will be used as base URL.

clearRepository

public boolean clearRepository()
Clear the contents of the current repository.

Returns:
true if successfull

evalRdqlQuery

public Vector evalRdqlQuery(String query)
Evaluate an RDQL query over the data held in the current repository

Parameters:
query - the text of the query to evaluate
Returns:
a Vector containing the distinct results of the query. NOTE: Each element of that Vector is a String[] contating the URI's of particular distinct result of the evaluated query.

evalRqlQuery

public Vector evalRqlQuery(String query)
Evaluate an RQL query over the data held in the current repository

Parameters:
query - the text of the query to evaluate
Returns:
a Vector containing the distinct results of the query. NOTE: Each element of that Vector is a String[] contating the URI's of particular distinct result of the evaluated query.

extractRDF

public String extractRDF(boolean ontology,
                         boolean instances,
                         boolean explicit)
Etract the contents of the current repository as RDF.

Parameters:
ontology - flag indicating to include the ontoloy in the result
instances - flag indicating to include instances in the result
explicit - flag indicating to include only explicit statements in the result
Returns:
a string containig the RDF data of the export

getClasses

public Vector getClasses()
Retrive a list of the defined classes in the repository

Returns:
Vector containig the URI's of the classes

getClassesOf

public Vector getClassesOf(String anInstance,
                           boolean mostSpecific)
Retrive a list of classes to which an Instance belongs

Parameters:
anInstance - Instance to explore
mostSpecific - flag indicating that only the most specific classes to be included in the result
Returns:
Vector containig the URI's of the classes

getInstancesOf

public Vector getInstancesOf(String aClass,
                             boolean proper)
Retrive a list of URI's of an instances about specific class

Parameters:
aClass - Class to explore
proper - flag indicating thet only the proper instances to be included in the result
Returns:
Vector containig the URI's of the instances

getProperties

public Vector getProperties()
Retrive a list of the defined properties in the repository

Returns:
Vector containig the URI's of the properties

getStatements

public Vector getStatements(String subj,
                            String pred,
                            String obj,
                            boolean explicitOnly,
                            boolean objIsLiteral)
Retrive a list of the statemnets from the repository. All the statements that match the provided pattern will be included into teh result

Parameters:
subj - URI of the subject, The null means that the subject does not mather and the statement will be included regarding on the match of its other componets(predicate, object, or is it an explicit one)
pred - URI of the predicate. Tha same rule for the null value is valid
obj - URI of the object. Tha same rule for the null value is valid
explicitOnly - flag indicating that only the explicit statements to be included in the result
objIsLiteral - indicating the the URI of the object is actually an Literal not an Resource URI.
Returns:
Vector containig the String[] with URI's of the distinct componets of each statement (subject, predicate and object)

hasStatement

public boolean hasStatement(String subj,
                            String pred,
                            String obj,
                            boolean explicitOnly,
                            boolean objIsLiteral)
Query the repository for particular statement

Parameters:
subj - URI of Subject
pred - URI of Predicate
obj - URI of Object
explicitOnly - flag indicating the the statement is explicit
objIsLiteral - flag indicationg thet object's URI is actuallt a Literal

getSubClassesOf

public Vector getSubClassesOf(String resource,
                              boolean direct)
Retrieve a list of the subclasses of a class

Parameters:
resource - URI of the class
direct - flag indicating to include only its direct subclasses
Returns:
Vector containing the URI's of the subclasses

getSubPropertiesOf

public Vector getSubPropertiesOf(String resource,
                                 boolean direct)
Retrieve a list of the subproperties of a property

Parameters:
resource - URI of the property
direct - flag indicating to include only its direct properties
Returns:
Vector containing the URI's of the subproperties

getSuperClassesOf

public Vector getSuperClassesOf(String resource,
                                boolean direct)
Retrieve a list of the superclasses of a class

Parameters:
resource - URI of the class
direct - flag indicating to include only its direct superclasses
Returns:
Vector containing the URI's of the superclasses

getSuperPropertiesOf

public Vector getSuperPropertiesOf(String resource,
                                   boolean direct)
Retrieve a list of the superproperties of a property

Parameters:
resource - URI of the property
direct - flag indicating to include only its direct properties
Returns:
Vector containing the URI's of the superproperties

isClass

public boolean isClass(String resource)
Check that a URI is a class

Parameters:
resource - URI to check
Returns:
true if not fail

isProperty

public boolean isProperty(String resource)
Check that a URI is a property

Parameters:
resource - URI to check
Returns:
true if not fail

isInstanceOf

public boolean isInstanceOf(String anInstance,
                            String aClass,
                            boolean proper)
Check that a URI is an instance of a class

Parameters:
anInstance - URI of the instance to check
aClass - URI of the class to check for
proper - flag indication that only the proper instances of the class will match the criteria
Returns:
true if not fail

isSubClassOf

public boolean isSubClassOf(String subClass,
                            String superClass,
                            boolean direct)
Query for subsumtion of two classes

Parameters:
subClass - URI of the subClass
superClass - URI of the superClass
direct - flag indicating to check for direct subsumption
Returns:
true if not fail

isSubPropertyOf

public boolean isSubPropertyOf(String subProperty,
                               String superProperty,
                               boolean direct)
Query for subsumtion of two properties

Parameters:
subProperty - URI of the subProperty
superProperty - URI of the superProperty
direct - flag indicating to check for direct subsumption
Returns:
true if not fail

removeStatements

public int removeStatements(String subjURI,
                            String predURI,
                            String objURI,
                            boolean bObjectIsLiteral)
remove statements from the repository

Parameters:
subjURI - URI of the subject
predURI - URI of the predicate
objURI - URI of the object
bObjectIsLiteral - flag indicating that the URI of the object is Literal

uploadData

public int uploadData(String data,
                      String baseURL)
Upload RDF(S) data to current repository

Parameters:
data - valid RDF content to upload
baseURL - the namespace of the uploaded content

labelState

public void labelState(String stateUID,
                       String label)
Create a labeled version for a statte of the repository assigning the necessary mata-information about thet operation.

Parameters:
stateUID - the update counetr of a particular repository state
label - the label to be set for this state NOTE: This method can throw a security exception if the request is made on behalf of the user with insufficent rights to create versions

labelCurrentState

public void labelCurrentState(String label)
Create a labeled version of the curent repository state. NOTE: This method can throw an exception if the request is made on behalf of an user with insufficent rights to create versions


revertToState

public void revertToState(String stateUID)
Restore the repository to previous state removing all statements added after the value of the update counter and revive all remover ones.

Parameters:
stateUID - the update counter of a particular repository state NOTE: This method can throw an exception if the request is made on behalf of an user with insufficent rights to revert the repository

workWithState

public void workWithState(String stateUID)
Sets the repository to given state for further read operations.

Parameters:
stateUID - the update counter of a particular repository state

branchState

public String branchState(String stateUID)
branch the repository at given state for further operations.

Parameters:
stateUID - the update counter of a particular repository state
Returns:
the id of the repository

getVersions

public Vector getVersions()
Retrive list of all labeled states of the repository.

Returns:
a list of Versin interfaces for each labeled state of the repository

getUpdateIds

public Vector getUpdateIds()
Retrive list of all Updates of the repository.

Returns:
a list of Updates of the repository

pauseCounterIncrement

public void pauseCounterIncrement()
Stop the increment of the update counter. Usefull for a kind of batch updates or adding a distinct daml coinstructs at once.


continueCounterIncrement

public void continueCounterIncrement()
Coninue with the normal increment of the update counter on each modification made in the repository.


isPausedCounterIncrement

public boolean isPausedCounterIncrement()
Check if the update couter ss paused

Returns:
true if the updateCouter is paused, flase otherwise

getVersionIds

public Vector getVersionIds()

getMetaInfo

public Map getMetaInfo(String subj,
                       String pred,
                       String obj)

getVersionMetaInfo

public Map getVersionMetaInfo(String versionId)

getUpdateMetaInfo

public Map getUpdateMetaInfo(String updateId)


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.