Alignment API and Server 4.1.${version.update}

fr.inrialpes.exmo.ontowrap.skosapi
Class SKOSThesaurus

java.lang.Object
  extended by fr.inrialpes.exmo.ontowrap.BasicOntology<org.semanticweb.skos.SKOSDataset>
      extended by fr.inrialpes.exmo.ontowrap.skosapi.SKOSThesaurus
All Implemented Interfaces:
HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>, LoadedOntology<org.semanticweb.skos.SKOSDataset>, Ontology<org.semanticweb.skos.SKOSDataset>

public class SKOSThesaurus
extends BasicOntology<org.semanticweb.skos.SKOSDataset>
implements HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>


Field Summary
(package private)  org.semanticweb.skos.SKOSDataFactory factory
           
private static HashSet NullSet
           
 
Fields inherited from class fr.inrialpes.exmo.ontowrap.BasicOntology
file, formalism, formalismURI, onto, uri
 
Constructor Summary
SKOSThesaurus()
           
 
Method Summary
 boolean getCapabilities(int Direct, int Asserted, int Named)
          THESE ARE HEAVY LOADED PRIMITIVES
 Set<?> getClasses()
           
 Set<Object> getClasses(Object i, int local, int asserted, int named)
           
 Set<?> getDataProperties()
           
 Set<Object> getDataProperties(Object c, int local, int asserted, int named)
           
 void getDataValues(org.semanticweb.skos.SKOSConcept o, org.semanticweb.skos.SKOSDataProperty p, Set<String> result)
          onto.getSKOSDataRelationAssertions(concept) assertion.getSKOSObject(); if (literal.isTyped()) { SKOSTypedLiteral typedLiteral = literal.getAsSKOSTypedLiteral(); System.out.println("\t\t" + assertion.getSKOSProperty().getURI().getFragment() + " " + literal.getLiteral() + " Type:" + typedLiteral.getDataType().getURI() ); } else { SKOSUntypedLiteral untypedLiteral = literal.getAsSKOSUntypedLiteral(); if (untypedLiteral.hasLang()) { lang = untypedLiteral.getLang(); }}
 void getDataValues(org.semanticweb.skos.SKOSConcept o, org.semanticweb.skos.SKOSDataProperty p, Set<String> result, String lang)
           
 Set<Object> getDomain(Object p, int asserted)
           
 Set<?> getEntities()
          Returns all named entities having URI beginning with the ontology URI
 Object getEntity(URI u)
           
 Set<String> getEntityAnnotations(Object o)
          Returns all the values of the "owl:AnnotationProperty" property for a given entity.
 Set<String> getEntityAnnotations(Object o, String lang)
          There is no languages on annotations in SKOS API Hence we return all of them
 Map<String,String> getEntityAnnotationsL(Object o)
           
 Set<String> getEntityComments(Object o)
          Returns all the values of the "rdfs:comment" property for a given entity
 Set<String> getEntityComments(Object o, String lang)
          Returns the values of the "rdfs:comment" property for a given entity and for a given natural language (attribute xml:lang).
 String getEntityName(Object o)
          returns one of the prefLabel property values for a given SKOS concept.
 String getEntityName(Object o, String lang)
          returns one of the prefLabel property values for a given SKOS concept in a given language.
 Set<String> getEntityNames(Object o)
          Returns the values of the prefLabel, hiddenLabel and altLabel properties.
 Set<String> getEntityNames(Object o, String lang)
          Returns the values of the prefLabel, hiddenLabel and altLabel properties in a given language.
 URI getEntityURI(Object o)
           
 Set<?> getIndividuals()
           
 Set<Object> getInstances(Object c, int local, int asserted, int named)
           
 Set<?> getObjectProperties()
           
 Set<Object> getObjectProperties(Object c, int local, int asserted, int named)
           
 Set<?> getProperties()
           
 Set<Object> getProperties(Object c, int local, int asserted, int named)
           
 Set<Object> getRange(Object p, int asserted)
           
 Set<Object> getSubClasses(Object c, int local, int asserted, int named)
           
 Set<Object> getSubProperties(Object p, int local, int asserted, int named)
           
 Set<Object> getSuperClasses(Object c, int local, int asserted, int named)
           
 Set<Object> getSuperProperties(Object p, int local, int asserted, int named)
           
 boolean isClass(Object o)
           
 boolean isDataProperty(Object o)
           
 boolean isEntity(Object o)
           
 boolean isIndividual(Object o)
           
 boolean isObjectProperty(Object o)
           
 boolean isProperty(Object o)
           
 int nbClasses()
           
 int nbDataProperties()
           
 int nbEntities()
           
 int nbIndividuals()
           
 int nbObjectProperties()
           
 int nbProperties()
           
 void setFactory(org.semanticweb.skos.SKOSDataFactory df)
           
 void unload()
           
 
Methods inherited from class fr.inrialpes.exmo.ontowrap.BasicOntology
getFile, getFormalism, getFormURI, getFragmentAsLabel, getOntology, getURI, setFile, setFormalism, setFormURI, setOntology, setURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.inrialpes.exmo.ontowrap.Ontology
getFile, getFormalism, getFormURI, getOntology, getURI, setFile, setFormalism, setFormURI, setOntology, setURI
 

Field Detail

factory

org.semanticweb.skos.SKOSDataFactory factory

NullSet

private static HashSet NullSet
Constructor Detail

SKOSThesaurus

public SKOSThesaurus()
Method Detail

setFactory

public void setFactory(org.semanticweb.skos.SKOSDataFactory df)

getDataValues

public void getDataValues(org.semanticweb.skos.SKOSConcept o,
                          org.semanticweb.skos.SKOSDataProperty p,
                          Set<String> result)
onto.getSKOSDataRelationAssertions(concept) assertion.getSKOSObject(); if (literal.isTyped()) { SKOSTypedLiteral typedLiteral = literal.getAsSKOSTypedLiteral(); System.out.println("\t\t" + assertion.getSKOSProperty().getURI().getFragment() + " " + literal.getLiteral() + " Type:" + typedLiteral.getDataType().getURI() ); } else { SKOSUntypedLiteral untypedLiteral = literal.getAsSKOSUntypedLiteral(); if (untypedLiteral.hasLang()) { lang = untypedLiteral.getLang(); }}


getDataValues

public void getDataValues(org.semanticweb.skos.SKOSConcept o,
                          org.semanticweb.skos.SKOSDataProperty p,
                          Set<String> result,
                          String lang)

getEntityName

public String getEntityName(Object o)
                     throws OntowrapException
returns one of the prefLabel property values for a given SKOS concept.

Specified by:
getEntityName in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
Returns:
a label
Throws:
OntowrapException - JE// This is not satisfying because in case of several PrefLabels it will return the first one...

getEntityName

public String getEntityName(Object o,
                            String lang)
                     throws OntowrapException
returns one of the prefLabel property values for a given SKOS concept in a given language.

Specified by:
getEntityName in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
lang - the code of the language ("en", "fr", "es", etc.)
Returns:
a label
Throws:
OntowrapException - JE// This is not satisfying because in case of several PrefLabels it will return the first one...

getEntityNames

public Set<String> getEntityNames(Object o,
                                  String lang)
                           throws OntowrapException
Returns the values of the prefLabel, hiddenLabel and altLabel properties in a given language.

Specified by:
getEntityNames in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
lang - the code of the language ("en", "fr", "es", etc.)
Returns:
the set of labels
Throws:
OntowrapException

getEntityNames

public Set<String> getEntityNames(Object o)
                           throws OntowrapException
Returns the values of the prefLabel, hiddenLabel and altLabel properties.

Specified by:
getEntityNames in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the concept
Returns:
the set of labels
Throws:
OntowrapException

getEntityComments

public Set<String> getEntityComments(Object o,
                                     String lang)
                              throws OntowrapException
Returns the values of the "rdfs:comment" property for a given entity and for a given natural language (attribute xml:lang).

Specified by:
getEntityComments in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
lang - the code of the language ("en", "fr", "es", etc.)
Returns:
the set of comments
Throws:
OntowrapException

getEntityAnnotationsL

public Map<String,String> getEntityAnnotationsL(Object o)
                                         throws OntowrapException
Specified by:
getEntityAnnotationsL in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Throws:
OntowrapException

getEntityComments

public Set<String> getEntityComments(Object o)
                              throws OntowrapException
Returns all the values of the "rdfs:comment" property for a given entity

Specified by:
getEntityComments in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
Returns:
the set of comments
Throws:
OntowrapException

getEntityAnnotations

public Set<String> getEntityAnnotations(Object o)
                                 throws OntowrapException
Returns all the values of the "owl:AnnotationProperty" property for a given entity. These annotations are those predefined in owl (owl:versionInfo, rdfs:label, rdfs:comment, rdfs:seeAlso and rdfs:isDefinedBy) In SKOS, they also are: skos:notation Annotation properties: skos:note, skos:changeNote, skos:definition, skos:editorialNote, skos:example, skos:historyNote and skos:scopeNote but also all other defined annotation properties which are subClass of "owl:AnnotationProperty"

Specified by:
getEntityAnnotations in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
Returns:
the set of annotation values
Throws:
OntowrapException

getEntityAnnotations

public Set<String> getEntityAnnotations(Object o,
                                        String lang)
                                 throws OntowrapException
There is no languages on annotations in SKOS API Hence we return all of them

Specified by:
getEntityAnnotations in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Parameters:
o - the entity
lang - the code of the language ("en", "fr", "es", etc.)
Returns:
the set of annotation values
Throws:
OntowrapException

getEntity

public Object getEntity(URI u)
                 throws OntowrapException
Specified by:
getEntity in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Throws:
OntowrapException

getEntityURI

public URI getEntityURI(Object o)
                 throws OntowrapException
Specified by:
getEntityURI in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Throws:
OntowrapException

getClasses

public Set<?> getClasses()
Specified by:
getClasses in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

getDataProperties

public Set<?> getDataProperties()
Specified by:
getDataProperties in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

getEntities

public Set<?> getEntities()
Description copied from interface: LoadedOntology
Returns all named entities having URI beginning with the ontology URI

Specified by:
getEntities in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>
Returns:
the set of entities

getIndividuals

public Set<?> getIndividuals()
Specified by:
getIndividuals in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

getObjectProperties

public Set<?> getObjectProperties()
Specified by:
getObjectProperties in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

getProperties

public Set<?> getProperties()
Specified by:
getProperties in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

isClass

public boolean isClass(Object o)
Specified by:
isClass in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

isDataProperty

public boolean isDataProperty(Object o)
Specified by:
isDataProperty in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

isEntity

public boolean isEntity(Object o)
Specified by:
isEntity in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

isIndividual

public boolean isIndividual(Object o)
Specified by:
isIndividual in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

isObjectProperty

public boolean isObjectProperty(Object o)
Specified by:
isObjectProperty in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

isProperty

public boolean isProperty(Object o)
Specified by:
isProperty in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

nbEntities

public int nbEntities()
Specified by:
nbEntities in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

nbClasses

public int nbClasses()
Specified by:
nbClasses in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

nbDataProperties

public int nbDataProperties()
Specified by:
nbDataProperties in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

nbIndividuals

public int nbIndividuals()
Specified by:
nbIndividuals in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

nbObjectProperties

public int nbObjectProperties()
Specified by:
nbObjectProperties in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

nbProperties

public int nbProperties()
Specified by:
nbProperties in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

unload

public void unload()
Specified by:
unload in interface LoadedOntology<org.semanticweb.skos.SKOSDataset>

getCapabilities

public boolean getCapabilities(int Direct,
                               int Asserted,
                               int Named)
THESE ARE HEAVY LOADED PRIMITIVES

Specified by:
getCapabilities in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getSubClasses

public Set<Object> getSubClasses(Object c,
                                 int local,
                                 int asserted,
                                 int named)
Specified by:
getSubClasses in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getSuperClasses

public Set<Object> getSuperClasses(Object c,
                                   int local,
                                   int asserted,
                                   int named)
Specified by:
getSuperClasses in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getProperties

public Set<Object> getProperties(Object c,
                                 int local,
                                 int asserted,
                                 int named)
Specified by:
getProperties in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getDataProperties

public Set<Object> getDataProperties(Object c,
                                     int local,
                                     int asserted,
                                     int named)
Specified by:
getDataProperties in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getObjectProperties

public Set<Object> getObjectProperties(Object c,
                                       int local,
                                       int asserted,
                                       int named)
Specified by:
getObjectProperties in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getInstances

public Set<Object> getInstances(Object c,
                                int local,
                                int asserted,
                                int named)
Specified by:
getInstances in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getSubProperties

public Set<Object> getSubProperties(Object p,
                                    int local,
                                    int asserted,
                                    int named)
Specified by:
getSubProperties in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getSuperProperties

public Set<Object> getSuperProperties(Object p,
                                      int local,
                                      int asserted,
                                      int named)
Specified by:
getSuperProperties in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getRange

public Set<Object> getRange(Object p,
                            int asserted)
Specified by:
getRange in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getDomain

public Set<Object> getDomain(Object p,
                             int asserted)
Specified by:
getDomain in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

getClasses

public Set<Object> getClasses(Object i,
                              int local,
                              int asserted,
                              int named)
Specified by:
getClasses in interface HeavyLoadedOntology<org.semanticweb.skos.SKOSDataset>

Alignment API and Server 4.1.${version.update}

(C) INRIA & friends, 2003-${curryear}