THE KNOWLEDGE REPOSITORY SERVICES API REFERENCE (version 2.0)

SERVICE CATEGORY SERVICE NAME METHOD NAME DESCRIPTION/PRECONDITIONS/EFFECTS METHOD SIGNATURE
KNOWLEDGE REPOSITORY SERVICES IMPORTER SERVICE STORE Description:
Imports in the underlying storage the specified namespaces and/or graphspaces.
Preconditions:
  • The array of URIs has exactly the same number of elements as the array of data.
  • Format is either "TRIG" or "RDF_XML".
  • If an RDF space declares its own URI (in a syntax-specific way), it must be the same as the respective entry in the array of URIs.
Effects:
After the successful execution of the operation, the underlying storage will contain all supplied RDF spaces, identified by their respective URIs.
void store(
java.lang.String[] uris,
java.lang.String[] data,
java.lang.String formatDesc,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
    STORE WITH DEPENDENCIES Description:
Imports in the underlying storage the specified namespaces and/or graphspaces, along with their dependencies.
Preconditions:
  • The array of URIs has exactly the same number of elements as the array of data.
  • Format is either "TRIG" or "RDF_XML".
  • If an RDF space declares its own URI (in a syntax-specific way), it must be the same as the respective entry in the array of URIs.
Effects:
After the successful execution of the operation, the underlying storage will contain all supplied RDF spaces, identified by their respective URIs (see above), and all their dependencies, recursively.
public void storeWithDependencies(
java.lang.String[] uris,
java.lang.String[] data,
java.lang.String formatDesc,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
EXPORTER SERVICE FETCH Description:
Fetches the RDF contents of the requested URIs from the underlying storage, using the requested format. Accepted formats are: "TRIG", "RDF_XML".
Preconditions:
  • Format is either "TRIG" or "RDF_XML"
Effects:
Only the requested namespaces and/or graphspaces are returned; not their dependencies. Section 2.1 explains the notion of dependencies among RDF spaces.
public java.lang.String[][] fetchWithData(
java.lang.String[] spaces,
java.lang.String formatDesc,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings
  FETCH WITH DEPENDENCIES Description:
Fetches the RDF contents of the requested URIs from the underlying storage and all their dependencies, using the requested format. Accepted formats are: "TRIG", "RDF_XML".
Preconditions:
  • Format is either "TRIG" or "RDF_XML"
Effects:
An error is raised if a requested URI, or any URI reachable recursively through dependencies cannot be located (i.e. it has not been stored in the past). Section 2.1 explains the notion of dependencies among RDF spaces. The returned array contains rows with RDF documents, in the requested format. Each row has exactly two String elements, the URI of a returned document, and the document itself.
public java.lang.String[][] fetchWithDependencies(
java.lang.String[] spaces,
java.lang.String formatDesc,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
  FETCH WITH DATA Description:
Fetches the RDF contents of the requested URIs from the underlying storage, as "Fetch" operation does. Additionally, for every requested namespace, it returns a document containing every data element that is related to that namespace (for example, a class instance of a class declared in that namespace).
Preconditions:
  • Format is either "TRIG" or "RDF_XML"
Effects:
Only the requested namespaces and/or graphspaces are returned; not their dependencies.
public java.lang.String[][] fetch(
java.lang.String[] spaces,
java.lang.String formatDesc,
gr.forth.ics.rdfsuite.services.DbSettingss dbSettings)
  FETCH WITH DATA AND DEPENDENCIES Description:
Fetches the RDF contents of the requested URIs from the underlying storage, as "Fetch with dependencies" operation does. Additionally, for every requested namespace, it returns a document containing every data element that is related to that namespace (for example, a class instance of a class declared in that namespace).
Preconditions:
  • Format is either "TRIG" or "RDF_XML"
Effects:
An error is raised if a requested URI, or any URI reachable recursively through dependencies cannot be located (i.e. it has not been stored in the past). The returned array contains rows with RDF documents (the requested ones plus the artificial documents, one for each namespace), in the requested format. Each row has exactly two String elements, the URI of a returned document, and the document itself.
public java.lang.String[][] fetchWithDataAndDependencies(
java.lang.String[] spaces,
java.lang.String formatDesc,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
QUERY SERVICE QUERY/ QUERY MULTIPLE Description:
Evaluates an RQL query, and returns the results using the requested format. Accepted formats are: "TRIG", "RDF_XML".
Preconditions:
  • Format is either "TRIG" or "RDF_XML"
Effects:
In case of a syntactically wrong query, a result will be returned, in the specified format, containing an error message.
public java.lang.String query(
java.lang.String queryString,
java.lang.String preferredFormat,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)

public java.lang.String[] queryMultiple(
java.lang.String[] queryStrings,
java.lang.String preferredFormat,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
UPDATE SERVICE UPDATE / UPDATE MULTIPLE Description:
Evaluates an RUL query, and returns the results using the requested format. Accepted formats are: "TRIG", "RDF_XML".
Preconditions:
  • Format is either "TRIG" or "RDF_XML"
Effects:
In case of a syntactically wrong query, a result will be returned, in the specified format, containing an error message.
public boolean update(
java.lang.String rul,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)

AND
public java.lang.Boolean[] updateMultiple(
java.lang.String[] ruls,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
DELETE SERVICE STORE Description:
Deletes one or more namespaces from main memory and persistent storage. Preconditions:
  • Namespaces have to exist in the repository.
Effects:
All namespace will be removed from memory and the persistent storage. If the fag WITHDATA is set then also the correspoding data to these namespaces will be deleted.
public boolean store(
java.lang.String[] uris,
java.lang.String formatDesc)
KNOWLEDGE MEDIATOR SERVICE VERSIONING SERVICE IMPORT VERSION Description:
The purpose of this operation is to store a new version in the repository. The document itself is provided as a whole (RDFDocument parameter), and it can be either a namespace or a graphspace.
Preconditions:
  • None
Effects:
A new version is created in the repository.
public java.lang.String importVersion(
gr.forth.ics.rdfsuite.services.RdfDocument document,
java.util.Collection < java.lang.String > parentVersions,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
  CREATE AND IMPORT VERSIONS Description:
The purpose of this operation is to store multiple versions in the repository.
Preconditions:
  • None
Effects:
A new version is created in the repository.
public java.lang.String[][] createAndImportVersions(
java.util.Collection <java.lang.String&qt; existingVersions,
gr.forth.ics.rdfsuite.services.Delta delta,
gr.forth.ics.rdfsuite.services.VersionManager.UpdateSemantics updateSemantics,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
  IMPORT VERSION WITH SPECIFIC ID Description:
The purpose of this operation is to store a new version in the repository with a specific version ID. The document itself is provided as a whole (RDFDocument parameter), and it can be either a namespace or a graphspace.
Preconditions:
  • None
Effects:
A new version with a specific ID is created in the repository.
public java.lang.String importVersionWithSpecificId(
gr.forth.ics.rdfsuite.services.RdfDocument document,
java.util.Collection <java.lang.String> parentVersions,
java.lang.String versionId,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
CHANGE IMPACT SERVICE CHANGE IMPACT Description:
Estimates the outcomes of an update request upon an initial RDF KB.
Preconditions:
  • The array of strings of nameGraphSpaceURI at input, contains all the different name or graph spaces that come in the triples contained in the input delta.
  • Format of the files in added and deleted is "TRIG". Triples are fully-qualified.
  • In cases that the update contains one of the following triples:
    • P rdfs:domain A
    • P rdfs:subPropertyOf R
    • A rdf:type B
    • A rdfs:subClassOf B
    (with A,B,P,R fully qualified Uris) Then at least one resource out of subject or object must have its URI contained in the update or the initial KB (unless the resources are part of RDF Schema namespace).
Effects:
After the successful execution of the operation, the output will be a pair of strings, which represent the triples that should be added to and deleted from the original name and graph spaces. These triples are ready for set-theoretical addition/removal upon the initial sets of triples (if mode is OFF) or upon the "dependency" closure of these initial sets of triples (if mode is ON).
public gr.forth.ics.rdfsuite.services.Delta changeImpact(
gr.forth.ics.rdfsuite.services.Delta delta,
java.lang.String[] nameOrGraphspaceURIs,
gr.forth.ics.rdfsuite.services.ChangeImpactAnalyzer.NamespaceClosure mode,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
DIFF SERVICE DIFF Description:
The Comparison Service is responsible for comparing two collections of name or graph spaces (KBs) already stored in the repository and compute their delta in an appropriate form. The result of the comparison is a "delta" (or "diff") describing the differences between the two collections of name or graph spaces, i.e., the change(s) that should be applied upon the first in order to get to the second.
Preconditions:
  • Name and graph spaces that are described in nameGraphSpaceURI1 and nameGraphSpaceURI2 should already be stored in the repository.
  • Possible values for the deltaFunction parameter are: "D1", indicating that Delta Dense (Äd) should be used; "D2", indicating that Delta Closure (Äc) should be used; "D3", indicating that Delta Explicit (Äe) should be used; and "D4", indicating that Delta Dense & Closure (Ädc) should be used.
Effects:
None.
public gr.forth.ics.rdfsuite.services.Delta diff(
java.util.Collection<java.lang.String&qt; namespacesOrGraphspaces1,
java.util.Collection<java.lang.String&qt; namespacesOrGraphspaces2,
gr.forth.ics.rdfsuite.services.DeltaFunction deltaFunction,
gr.forth.ics.rdfsuite.services.DbSettings dbSettings)
REGISTRY SERVICE INSERTSCHEMA Description:
Inserts into the registry an instance of the class Schema(or subClasses) and one or more instances of class Version.
Preconditions:
The instances must be valid instances of the respective classes and be described by using the RDF/XML or TRIG format. The URI of the instance of class Schema given as parameter should be the same as the URI used in the file. The URI of the instance of class Version used in the file should be the same as the URI that emerges from the concatenation of the Schema instance URI, the delimiter "~_~" and the versionID. Moreover, both the URI of the Schema and the Version instances should have the format of a full URI. Finally, at least one Version instance must be provided.
Effects:
After the successful execution of the operation, the registry will contain the information of the instances of class Schema and Version identified by their respective URIs.
public void insertSchema(
java.lang.String schemaURI,
java.lang.String[] versionID,
java.lang.String file,
gr.forth.ics.rdfsuite.services.Format format)

  INSERT SCHEMA URI Description:
Inserts into the registry an instance of the class Schema(or subClasses) and one or more instances of class Version with no further information besides their provided URIs.
Preconditions:
The format of the URI of the Schema instance should be that of a full URI. At least one versionID is provided.
Effects:
After the successful execution of the operation, the registry will contain the Schema and Version instances URIs. The Version instance URI will be created from the concatenation of the Schema instance URI, the delimiter "~_~" and the versionID.
public void insertSchemaURI(
gr.forth.ics.rdfsuite.services.Registry.SchemaSubClasses className,
java.lang.String instanceURI,
java.lang.String[] versionID)

  INSERT PERSON / ORGANIZATION Description:
Inserts into the registry an instance of classes Person or Organization, subclasses of FOAF_Agent by correlating it with the property given as parameter to a specific instance of class Schema, Version, Language or Encoding which URI is given as parameter.
Preconditions:
The instances must be valid instances of the respective classes and be described by using the RDF/XML or TRIG format. The registry should not already contain an instance with the same URI as the one that is going to be inserted. On the other hand, the instance denoted by classURI should have already been stored. The Person/Organization instance URI should have the format of a full URI.
Effects:
After the successful execution of the operation, the registry will contain the information of the instances of class Person or Organization identified by their respective URIs.
public void insertPerson(
java.lang.String classURI,
java.lang.String[] personURI,
java.lang.String property,
java.lang.String file,
gr.forth.ics.rdfsuite.services.Formatt format)

AND
public void insertOrganization(
java.lang.String classURI,
java.lang.String[] organizationURI,
java.lang.String property,
java.lang.String file,
gr.forth.ics.rdfsuite.services.Format format)
  INSERT PERSON URI/ORGANIZATION URI Description:
Inserts into the registry an instance of classes Person or Organization, subclasses of FOAF_Agent with no further information besides their provided URIs. The inserted instance is correlated with the property given as parameter to a specific instance of class Schema, Version, Language or Encoding which URI is given as parameter.
Preconditions:
The format of the URI of the Person or Organization instance should be that of a full URI. The registry should not already contain an instance with the same URI as the one that is going to be inserted.
Effects:
After the successful execution of the operation, the registry will contain the Person or Organization instance.
public void insertPersonURI(
java.lang.String classURI,
java.lang.String[] personURI,
java.lang.String property)

AND
public void insertOrganizationURI(
java.lang.String classURI,
java.lang.String[] organizationURI,
java.lang.String property)
  INSERT INSTANCE Description:
Inserts into the registry a new instance of class className by correlating it to a specific instance (str1) which URI is given as parameter.
Preconditions:
The instances must be valid instances of the respective classes and be described by using the RDF/XML or TRIG format. Moreover, the instance URIs should have the format of a full URI and be the same as the ones used in the file. The instance denoted by correlateToUri should have already been stored. The parameter className has one of the following values: VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE. The registry should not already contain an instance with the same URI as the one that is going to be inserted.
Effects:
After the successful execution of the operation, the registry will contain the information of the instances of class className identified by their respective URIs.
public void insertInstance(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String correlateToUri,
java.lang.String[] instance,
java.lang.String file,
gr.forth.ics.rdfsuite.services.Format format)
  INSERT INSTANCE URI Description:
Inserts into the registry a new instance of class className with no further information besides its provided URI. The inserted instance is correlated to a specific instance (str1) which URI is given as parameter.
Preconditions:
The instance denoted by str1 should have already been stored. The parameter className has one of the following values VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE. The registry should not already contain an instance with the same URI as the one that is going to be inserted.
Effects:
After the successful execution of the operation, the registry will contain the URI of the instance of class className.
public void insertInstanceURI(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String correlateToUri,
java.lang.String[] instance)
  EDIT INSTANCE URI Description:
Edits the URI of an already stored instance of class className.
Preconditions:
The registry already contains an instance with URI oldURI that is instance of class className. The parameter className has one of the following values: SCHEMA, PERSON, ORGANIZATION, VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE. The new value of the URI that is denoted by the parameter newURI should have the correct format regarding to the className and also the format of a full URI.
Effects:
The registry will no longer contain an instance identified by oldURI. Instead it will contain a new instance with URI newURI. Moreover, all properties pointing from or to the instance with URI oldURI are transfered to the instance with URI newURI.
public void editInstanceURI(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String oldURI,
java.lang.String newURI)
  REMOVE INSTANCE Description:
Removes from the registry the instance of class className with URI instanceURI.
Preconditions:
The registry already contains an instance with URI instanceURI that is instance of class className. The parameter className has one of the following values SCHEMA, PERSON, ORGANIZATION, VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE.
Effects:
The registry will no longer contain the instance of class className with URI instanceURI. Moreover, all the properties that are pointing from or to this instance will also be removed. Finally, all instances that won't be correlated to other instances after the deletion will also be removed, except for instances of class Schema.
public void removeInstance(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String instanceURI)
  EXIST INSTANCE URI Description:
Checks if the instance with URI instanceURI exists in the registry and is instance of the class className.
Preconditions:
The parameter className has one of the following values SCHEMA, PERSON, ORGANIZATION, VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE.
Effects:
public boolean existInstanceURI(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String instanceURI)
  INSERT PROPERTY Description:
Inserts the property with name propertyName and value propertyValue to the instance with URI instanceURI that is instance of class classURI.
Preconditions:
The registry already contains an instance with URI instanceURI that is instance of class className. The parameter className has one of the following values SCHEMA, PERSON, ORGANIZATION, VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE. The parameter rangeType has one of the following values: STRING, NUMERIC, RESOURCE. If the parameter rangeType has the value RESOURCE , then the propertyValue must be the URI of an already stored instance.
Effects:
The instance with URI instanceURI will have a new property correlated to it.
public void insertProperty(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String instanceURI,
java.lang.String propertyName,
java.lang.String[] propertyValue,
gr.forth.ics.rdfsuite.services.Registry.PropertyRangeType rangeType)
  EDIT PROPERTY Description:
Edits the value of the property propertyName of the instance of class className with URI instanceURI.
Preconditions:
The registry already contains an instance with URI instanceURI that is instance of class className. The registry already contains the property with name propertyName and value oldValue. The parameter className has one of the following values SCHEMA, PERSON, ORGANIZATION, VERSION, CHANGE, LANGUAGE, ENCODING, PHYSICAL_LANGUAGE. The parameter rangeType has one of the following values: STRING, NUMERIC.
Effects: The property with name propertyName will have a new value assigned to it.
public void editProperty(
gr.forth.ics.rdfsuite.services.Registry.ClassName className,
java.lang.String instanceURI,
java.lang.String propertyName,
java.lang.String oldValue,
java.lang.String newValue,
gr.forth.ics.rdfsuite.services.Registry.PropertyRangeType rangeType)
  EVALUATE PREDEFINED QUERY Description:
Evaluates a query that is chosen from a list of predefined queries contained in an xml file. The query is characterized by the general family it belongs to (queryCategory) and its id (queryID). The parameters (param) given as argument are used as the parameters needed by the query.
Preconditions:
The values of the paramaters queryCategory and queryID are correct regarding to the xml file with the predefined queries.
Effects:
The selected query will be evaluated by replacing the parameters given and the result will be returned.
public java.lang.String evaluatePredefinedQuery(
java.lang.String queryCategory,
java.lang.String queryID,
java.lang.String[] param,
gr.forth.ics.rdfsuite.services.Format format)
  EVALUATE DYNAMIC QUERY Description:
Evaluates a dynamic query passed in a string.
Preconditions:
None
Effects:
The selected query will be evaluated by replacing the parameters given and the result will be returned.
public java.lang.String evaluatePredefinedQuery(
java.lang.String queryCategory,
java.lang.String queryID,
java.lang.String[] param,
gr.forth.ics.rdfsuite.services.Format format)