public class Instance extends Object implements TypeAdaptor
This class uses OntoBridge to connect with the ontology.
It can manage both short or long names to localize an instance:
For example: In the gaia.fdi.ucm.es/ontologies/Restaurant.owl ontology, the long name of the concept "wine" is
"gaia.fdi.ucm.es/ontologies/Restaurant.owl#wine.
The short name is just "wine" or "restaurant:wine" if "restaurant" is a defined prefix for that ontology.
TypeAdaptor| Constructor and Description |
|---|
Instance() |
Instance(String instance)
Creates an instance connected with the instance in the ontology.
|
Instance(String instance,
boolean useShortName)
Creates an Instance looking for the instance in the ontology with the same name.
|
| Modifier and Type | Method and Description |
|---|---|
static Instance |
createInstance(String instanceName,
String parentConcept) |
boolean |
equals(Object o)
You must define this method to avoid problems with the data base connector (Hibernate)
|
void |
fromString(String content)
Reads the type from a string.
|
int |
hashCode() |
String |
toString()
Returns a string representation of the type.
|
void |
useShortName(boolean yesno)
Indicates if using a long or short name.
|
public Instance()
public Instance(String instance, boolean useShortName) throws OntologyAccessException
The useShortName param allows using short or long names. For example:
In the gaia.fdi.ucm.es/ontologies/Restaurant.owl ontology, the long name of the concept "wine" is "gaia.fdi.ucm.es/ontologies/Restaurant.owl#wine.
The short name is just "wine" or "restaurant:wine" if "restaurant" is a defined prefix for that ontology.
instance - Name of the concept in the ontologyuseShortName - Use long or short nameOntologyAccessExceptionpublic Instance(String instance) throws OntologyAccessException
instance - Name of the concept in the ontologyOntologyAccessExceptionpublic static Instance createInstance(String instanceName, String parentConcept)
public void fromString(String content) throws OntologyAccessException
TypeAdaptorfromString in interface TypeAdaptorOntologyAccessExceptionpublic String toString()
TypeAdaptortoString in interface TypeAdaptortoString in class Objectpublic boolean equals(Object o)
TypeAdaptorequals in interface TypeAdaptorequals in class Objectpublic void useShortName(boolean yesno)
yesno - Copyright © 2018 Group of Artificial Intelligence Applications (GAIA). All rights reserved.