kaos.owls.ontology
Class OwlsOntClassLoader

java.lang.Object
  extended by kaos.owls.ontology.OwlsOntClassLoader

public class OwlsOntClassLoader
extends java.lang.Object


Field Summary
protected static int _anonClsIncrement
           
protected  Logger _logger
           
protected  java.util.List _serviceList
           
protected  boolean _useServiceName
           
static java.lang.String KAOS_OWLS_NAMESPACE
           
static java.lang.String PROCESS_INPUT_LABEL
           
static java.lang.String PROCESS_OUTPUT_LABEL
           
 
Constructor Summary
OwlsOntClassLoader()
          Create a new empty OwlsOntClassLoader - used to access static fields and methods of this class through Reflection
OwlsOntClassLoader(java.lang.String serviceOwls)
          Create a new OwlsOntClassLoader for the list of Service descriptions found in the given OWL-S string
OwlsOntClassLoader(java.net.URL serviceURL)
          Create a new OwlsOntClassLoader for the list of Service descriptions found at the given URI
 
Method Summary
protected  void addPropertyRangeClasses(java.util.List propertyList, KAoSClassBuilderImpl kcb, java.lang.String paramTypeLabel)
          For each OWL-S service parameter defined in the propertyList, add a property with the appropriate range restriction to the representative KAoS Action class in the kcb
protected  java.lang.String copyOntClass(OntClass sourceClass, KAoSClassBuilderImpl targetClassBuilder)
          Copy an anonymous class definition from one ontology model to another.
 SerializableOntModelImpl getAllKAoSActionClasses()
          Return a single OntModel containg the KAoS Action classes for every process in the OWL-S for this ontology loader
 java.util.Vector getAllProcesses(java.util.List serviceList)
          Get all OWL-S Processes (Composite, Simple, or Atomic) defined in the given list of OWL-S Services
 java.util.Vector getDistinctProcesses()
          Get all OWL-S Processes (Composite, Simple, or Atomic) defined in the OWL-S Service used to construct this class
 java.util.Vector getDistinctProcesses(java.util.List serviceList)
          Get all OWL-S Processes (Composite, Simple, or Atomic) defined in the given list of OWL-S Services
 Model getJenaModel()
           
protected  java.lang.String getKAoSClassName(java.lang.Process ap, boolean useServiceName)
          Convert the URI for a given OWL-S Process to a class name for a KAoS Action subclass.
protected  java.lang.String getKAoSPropertyName(Parameter owlsParameter)
          Convert the URI for a given OWL-S parameter to a property name for a KAoS Action subclass.
 KAoSClassBuilderImpl getKCBForProcess(java.lang.Process owlsProcess)
          Create a KAoS Action class (KAoSClassBuilder) for single owl-s Process
protected  java.util.Vector getProcesses(java.lang.Process inProcess)
          Recursively traverse Composite process descriptions to return all child processes of the given process.
 void getProcessFromKCB(KAoSClassBuilderImpl kcb)
          Create an OWL-S process from the given KAoSClassBuilder
static boolean isServiceDescription(java.lang.String owlString)
           
static boolean isServiceDescription(java.net.URL owlURL)
           
 java.lang.String loadKAoSActionClasses(KAoSAgentDirectoryServiceProxy ontRepository)
          Create the full set of KAoS Action classes for the processes in the OWL-S for this ontology loader.
 java.lang.String loadKAoSActionClasses(KAoSDirectoryService ontRepository)
          Create the full set of KAoS Action classes for the processes in the OWL-S for this ontology loader.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KAOS_OWLS_NAMESPACE

public static final java.lang.String KAOS_OWLS_NAMESPACE
See Also:
Constant Field Values

PROCESS_INPUT_LABEL

public static final java.lang.String PROCESS_INPUT_LABEL
See Also:
Constant Field Values

PROCESS_OUTPUT_LABEL

public static final java.lang.String PROCESS_OUTPUT_LABEL
See Also:
Constant Field Values

_anonClsIncrement

protected static int _anonClsIncrement

_serviceList

protected java.util.List _serviceList

_logger

protected Logger _logger

_useServiceName

protected boolean _useServiceName
Constructor Detail

OwlsOntClassLoader

public OwlsOntClassLoader()
Create a new empty OwlsOntClassLoader - used to access static fields and methods of this class through Reflection


OwlsOntClassLoader

public OwlsOntClassLoader(java.net.URL serviceURL)
Create a new OwlsOntClassLoader for the list of Service descriptions found at the given URI

Parameters:
serviceURI - - location of the OWL-S Service descriptions

OwlsOntClassLoader

public OwlsOntClassLoader(java.lang.String serviceOwls)
Create a new OwlsOntClassLoader for the list of Service descriptions found in the given OWL-S string

Parameters:
serviceOwls - - string containing one or more OWL-S Service descriptions
Method Detail

main

public static void main(java.lang.String[] args)

isServiceDescription

public static boolean isServiceDescription(java.lang.String owlString)

isServiceDescription

public static boolean isServiceDescription(java.net.URL owlURL)

getJenaModel

public Model getJenaModel()

getAllKAoSActionClasses

public SerializableOntModelImpl getAllKAoSActionClasses()
Return a single OntModel containg the KAoS Action classes for every process in the OWL-S for this ontology loader

Returns:

loadKAoSActionClasses

public java.lang.String loadKAoSActionClasses(KAoSAgentDirectoryServiceProxy ontRepository)
                                       throws DirectoryFailure,
                                              ReasoningException,
                                              java.io.IOException
Create the full set of KAoS Action classes for the processes in the OWL-S for this ontology loader. Then load the action classes into the KAoS ontology repository (via the KAoS directory service)

Parameters:
ontRepository - - KAoS directory service into which the action classes will be loaded
Returns:
Throws:
DirectoryFailure
ReasoningException
java.io.IOException - // to call

loadKAoSActionClasses

public java.lang.String loadKAoSActionClasses(KAoSDirectoryService ontRepository)
                                       throws DirectoryFailure,
                                              ReasoningException,
                                              java.io.IOException
Create the full set of KAoS Action classes for the processes in the OWL-S for this ontology loader. Then load the action classes into the KAoS ontology repository (via the KAoS directory service)

Parameters:
ontRepository - - KAoS directory service into which the action classes will be loaded
Returns:
Throws:
DirectoryFailure
ReasoningException
java.io.IOException

getDistinctProcesses

public java.util.Vector getDistinctProcesses()
Get all OWL-S Processes (Composite, Simple, or Atomic) defined in the OWL-S Service used to construct this class

Returns:
Vector of OWL-S Process objects

getDistinctProcesses

public java.util.Vector getDistinctProcesses(java.util.List serviceList)
Get all OWL-S Processes (Composite, Simple, or Atomic) defined in the given list of OWL-S Services

Parameters:
serviceList - - list of OWL-S Service objects
Returns:
Vector of OWL-S Process objects

getAllProcesses

public java.util.Vector getAllProcesses(java.util.List serviceList)
Get all OWL-S Processes (Composite, Simple, or Atomic) defined in the given list of OWL-S Services

Parameters:
serviceList - - list of OWL-S Service objects
Returns:
Vector of OWL-S Process objects

getProcesses

protected java.util.Vector getProcesses(java.lang.Process inProcess)
Recursively traverse Composite process descriptions to return all child processes of the given process.

Parameters:
inProcess -
Returns:
- list of all Processes defined within the given Process (including the given process)

getKCBForProcess

public KAoSClassBuilderImpl getKCBForProcess(java.lang.Process owlsProcess)
Create a KAoS Action class (KAoSClassBuilder) for single owl-s Process

Parameters:
owlsProcess -
Returns:

getProcessFromKCB

public void getProcessFromKCB(KAoSClassBuilderImpl kcb)
Create an OWL-S process from the given KAoSClassBuilder

Parameters:
kcb -

addPropertyRangeClasses

protected void addPropertyRangeClasses(java.util.List propertyList,
                                       KAoSClassBuilderImpl kcb,
                                       java.lang.String paramTypeLabel)
For each OWL-S service parameter defined in the propertyList, add a property with the appropriate range restriction to the representative KAoS Action class in the kcb

Parameters:
propertyList - - list of Service parameters (e.g. inputs, outputs, effects)
kcb - - container for the KAoS Action classes being built from OWL-S

copyOntClass

protected java.lang.String copyOntClass(OntClass sourceClass,
                                        KAoSClassBuilderImpl targetClassBuilder)
Copy an anonymous class definition from one ontology model to another.

Parameters:
sourceClass - - the anonymous class definition (OWL-S) to copy
targetClassBuilder - - the container for the KAoS Action classes, the destination for the copy
Returns:
the URI to the newly created class in the targetClassBuilder

getKAoSClassName

protected java.lang.String getKAoSClassName(java.lang.Process ap,
                                            boolean useServiceName)
Convert the URI for a given OWL-S Process to a class name for a KAoS Action subclass. The result is a String URI of the form urn:KAoSOwls#ServiceName-ProcessName

Parameters:
ap -
Returns:

getKAoSPropertyName

protected java.lang.String getKAoSPropertyName(Parameter owlsParameter)
Convert the URI for a given OWL-S parameter to a property name for a KAoS Action subclass. The result is a String URI of the form urn:KAoSOwls#ParameterName

Parameters:
owlsParameter -
Returns: