requester
Class OntManagerImpl


java.lang.Object

  extended byrequester.OntManagerImpl

All Implemented Interfaces:
OntManagerIF, java.rmi.Remote

public class OntManagerImpl
extends java.lang.Object
implements OntManagerIF


Constructor Summary
OntManagerImpl()
           
 
Method Summary
 boolean addIndividuals(java.lang.String s)
          handing over a list of new individual that are to be added to the ontology.
 void addReport(java.lang.String s)
          addReport: generates the instances for one report (case report + subclasses AND instances for swpatho2.owl).
 void deleteAllIndividuals()
          deleteAllIndividuals: deletes all Individuals!
 void destroy()
           
 java.lang.String getCaseReportsOfIndividual(java.lang.String className)
           
 java.lang.String getConcept(java.lang.String s)
          getConcept: Used by UP Web service, gets a concept name and tries to find a concept.
 java.lang.String getConceptAdj(java.lang.String s)
          getConceptAdj: Searches for a concept combined with an adjective.
 java.lang.String getDiagnosis()
           
 java.lang.String getExistingRelation(java.lang.String s)
           
 int getIndividualCount()
          getIndividualCount: returns number of individuals in A-Box
 java.lang.String getPathReportID(java.lang.String ontName)
          getPathReportID: gets a URI of an Individual and returns the ID of a Pathology_Report-Individual.
 java.lang.String getRelations(java.lang.String s)
          getRelations: gets two concepts (uris) and returns a list of relations, that are between these concepts.
 java.lang.String getReportsContainingConcept(java.lang.String conceptName)
           
 java.lang.String getSuperClasses(java.lang.String s)
           
 void init()
          init: method, that has to be called once before communicating with the Web service.
 java.lang.String query(java.lang.String s)
          query: executes an RDQL-query. !!!
 java.lang.String query2(java.lang.String s)
          query2: executes an RDQL-query that asks for two parameters.
 void saveModels()
          saveModels: Saves model to individuals.owl.
 java.lang.String searchBest(java.lang.String conceptName)
          searchBest: gets a concept name and searches for the concept that matches best.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntManagerImpl


public OntManagerImpl()
Method Detail

init


public void init()
Description copied from interface: OntManagerIF
init: method, that has to be called once before communicating with the Web service. The Web service runs permanently, but after a Tomcat-Restart is has to be executed again. If Web service runs already, session is picked up (faster access, ontologies do not have to be opened again)

Specified by:
init in interface OntManagerIF

addReport


public void addReport(java.lang.String s)
Description copied from interface: OntManagerIF
addReport: generates the instances for one report (case report + subclasses AND instances for swpatho2.owl). Uses the UP Web service

Following format is used:

<report belongsToCaseReport="123456">
<section name="micro|macro|diagnosis|comment" value="text of section"/>
<section...
</report>

Specified by:
addReport in interface OntManagerIF
Parameters:
s - String

destroy


public void destroy()

query


public java.lang.String query(java.lang.String s)
Description copied from interface: OntManagerIF
query: executes an RDQL-query. !!!IMPORTANT: Query format must be like this:

SELECT ?<variable-name> WHERE ...

select and where has to be written in capital letters!!!

Specified by:
query in interface OntManagerIF
Parameters:
s - String: RDQL-string
Returns:
String: XML-String, format:

<result>
<conceptName value="..."/>
<conceptName...
</result>

query2


public java.lang.String query2(java.lang.String s)
Description copied from interface: OntManagerIF
query2: executes an RDQL-query that asks for two parameters.
!!!IMPORTANT: format of RDQL-query is essentially important! MUST be like this:

SELECT ?x, ?y WHERE ...

ONE space after SELECT, after comma and before WHERE! SELECT and WHERE have to be in capital letters. argnames x and y can be chosen arbitrarily. argnames will also appear in resultset!!!

Specified by:
query2 in interface OntManagerIF
Parameters:
s - String: RDQL-string
Returns:
String, XML-string containing results. Format:

<result>
<item x="..." y="..."/>
<item...
</result>

searchBest


public java.lang.String searchBest(java.lang.String conceptName)
Description copied from interface: OntManagerIF
searchBest: gets a concept name and searches for the concept that matches best. Returns URI

Works as follows:

- Performs substring query
- Edit distance for all results is measured
- result with lowest edit distance is returned

--> result is currently not limited to a maximum edit distance!!!

Specified by:
searchBest in interface OntManagerIF
Parameters:
conceptName - String: Local name of concept
Returns:
String: URI of best matching concept or null (if no concept was found that matches)

getCaseReportsOfIndividual


public java.lang.String getCaseReportsOfIndividual(java.lang.String className)
Specified by:
getCaseReportsOfIndividual in interface OntManagerIF

getIndividualCount


public int getIndividualCount()
Description copied from interface: OntManagerIF
getIndividualCount: returns number of individuals in A-Box

Specified by:
getIndividualCount in interface OntManagerIF
Returns:
int

getPathReportID


public java.lang.String getPathReportID(java.lang.String ontName)
Description copied from interface: OntManagerIF
getPathReportID: gets a URI of an Individual and returns the ID of a Pathology_Report-Individual. This value is stored in the DatatypeProperty hasID.

Specified by:
getPathReportID in interface OntManagerIF
Parameters:
ontName - String
Returns:
String

getReportsContainingConcept


public java.lang.String getReportsContainingConcept(java.lang.String conceptName)

addIndividuals


public boolean addIndividuals(java.lang.String s)
Description copied from interface: OntManagerIF
handing over a list of new individual that are to be added to the ontology. Format:

<action>
<individual conceptName="x">
<relation uri="x" value="y" type="DatatypeProperty | ObjectProperty"/>
<relation...
</individual>
<individual...
</action>

Specified by:
addIndividuals in interface OntManagerIF
Parameters:
s - String
Returns:
boolean

deleteAllIndividuals


public void deleteAllIndividuals()
Description copied from interface: OntManagerIF
deleteAllIndividuals: deletes all Individuals! Careful use!!!

Specified by:
deleteAllIndividuals in interface OntManagerIF

saveModels


public void saveModels()
Description copied from interface: OntManagerIF
saveModels: Saves model to individuals.owl. Note: only individuals.owl is saved, because it is the only file that is modified by Web service (A-Box)

Specified by:
saveModels in interface OntManagerIF

getConcept


public java.lang.String getConcept(java.lang.String s)
Description copied from interface: OntManagerIF
getConcept: Used by UP Web service, gets a concept name and tries to find a concept. URI is returned.

Following input format is used:

<lexlookup>
<noun>Lunge</noun>
<noun>...
</lexlookup>

Following output format is used:

<message>
<ll_reply>
<noun>uri|unknown</noun>
</ll_reply>
</message>

Specified by:
getConcept in interface OntManagerIF
Parameters:
s - String
Returns:
String

getRelations


public java.lang.String getRelations(java.lang.String s)
Description copied from interface: OntManagerIF
getRelations: gets two concepts (uris) and returns a list of relations, that are between these concepts. Also looks for is-a relations and relations inherited from superclasses. Also works, if domain is a superclass of concept2.

Following input format is used:

<rel_lookup>
<uri1>http://...</uri1>
<uri2>http://...</uri2>
</rel_lookup>

Following output format is used:

<message>
<ll_reply>
<property domain="..." range="..." name="name of property" type="allValuesFrom|someValuesFrom|hasValue|unknown" direct="Y|N"/>
<property...
</ll_reply>
</message>

Specified by:
getRelations in interface OntManagerIF
Parameters:
s - String
Returns:
String

getExistingRelation


public java.lang.String getExistingRelation(java.lang.String s)
Specified by:
getExistingRelation in interface OntManagerIF

getConceptAdj


public java.lang.String getConceptAdj(java.lang.String s)
                               throws java.rmi.RemoteException
Description copied from interface: OntManagerIF
getConceptAdj: Searches for a concept combined with an adjective. First it searches for a concept named concept_adj, if not successful, a concept is searched, that has a property named adj

Following input format is used:

<lex_lookup>
<noun>Pneumonie</noun>
<adj>interstitiell</adj>
</lex_lookup>

Following output format is used:

<message>
<ll_reply>
<noun>http://...</noun>
</ll_reply>
</message>

Specified by:
getConceptAdj in interface OntManagerIF
Parameters:
s - String
Returns:
String
Throws:
java.rmi.RemoteException

getDiagnosis


public java.lang.String getDiagnosis()
                              throws java.rmi.RemoteException
Specified by:
getDiagnosis in interface OntManagerIF
Throws:
java.rmi.RemoteException

getSuperClasses


public java.lang.String getSuperClasses(java.lang.String s)
Specified by:
getSuperClasses in interface OntManagerIF