|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The QueryEngine is part of the OntologyManager. It is used to retrieve the elements of the ontology by id, by type or as various collections.
OntologyManager
Method Summary | |
QueryEngineResultSet |
executeQuery(User user,
String query)
Executes a query string and returns the result as a QueryEngineResultSet. |
Association |
getAssociationById(User user,
String id)
Returns an association for a given id. |
int |
getAssociationCount(User user)
Returns the number of associations in the ontology that the user may see. |
Collection |
getAssociationRoles(User user,
Association assoc)
Returns a collection of all AssociationRole objects that are part of the given association. |
Collection |
getAssociations(User user,
Topic topic)
Returns a collection of all Association objects in which the given topic plays a role. |
Collection |
getAssociationsOfType(User user,
Topic type)
Returns a collection of all Association objects with the given type. |
Collection |
getClassRoots(User user)
Returns a collection of class Topic objects that have no superclasses. |
int |
getClassTopicCount(User user)
Returns the number of class topics in the ontology that the user may see. |
Collection |
getClassTopics(User user)
Returns a collection of all class Topic objects. |
Collection |
getClassTopicsByBeginning(User user,
String beginning)
Returns a collection of class Topic objects whose names match the given beginning (case-insensitive). |
Collection |
getClassTopicsBySubstring(User user,
String substring,
boolean searchComment)
Returns a collection of class Topic objects whose name (and optionally comment) contain the given substring (case-insensitive). |
Concept |
getConceptById(User user,
String id)
Returns a concept for a given id. |
Collection |
getInstanceRoots(User user)
Returns a collection of instance Topic objects that have no types. |
Collection |
getInstances(User user,
Topic topic)
Returns a collection of TypeInstance objects that represent the instances of a given type topic. |
int |
getInstanceTopicCount(User user)
Returns the number of non-class topics in the ontology that the user may see. |
Collection |
getInstanceTopics(User user)
Returns a collection of all non-class Topic objects. |
Collection |
getInstanceTopicsByBeginning(User user,
String beginning)
Returns a collection of non-class Topic objects whose names match the given beginning (case-insensitive). |
Collection |
getInstanceTopicsBySubstring(User user,
String substring,
boolean searchComment)
Returns a collection of non-class Topic objects whose name (and optionally comment) contain the given substring (case-insensitive). |
String |
getQuerySyntaxName()
Returns the name of the query language that is provided by the implementation of the QueryEngine. |
String |
getQuerySyntaxURL()
Returns a URL with human-readable information about the syntax of the query language that is provided by the implementation of the QueryEngine. |
String |
getQuerySyntaxVersion()
Returns the version of the query language that is provided by the implementation of the QueryEngine. |
Collection |
getSubclasses(User user,
Topic topic)
Returns a collection of SuperSubclass objects that represent the subclasses of a given class topic. |
Collection |
getSuperclasses(User user,
Topic topic)
Returns a collection of SuperSubclass objects that represent the superclasses of a given class topic. |
Topic |
getTopicById(User user,
String id)
Returns a topic for a given id. |
int |
getTopicCount(User user)
Returns the total number of topics in the ontology that the user may see. |
Collection |
getTopics(User user)
Returns a collection of all Topic objects. |
Collection |
getTopicsByBeginning(User user,
String beginning)
Returns a collection of Topic objects whose names match the given beginning (case-insensitive). |
Collection |
getTopicsBySubstring(User user,
String substring,
boolean searchComment)
Returns a collection of Topic objects whose name (and optionally comment) contain the given substring (case-insensitive). |
Collection |
getTypes(User user,
Topic topic)
Returns a collection of TypeInstance objects that represent the types of a given instance topic. |
String |
getVersion()
Returns an implementation specific version of the QueryEngine. |
Method Detail |
public QueryEngineResultSet executeQuery(User user, String query) throws QueryEngineException, DynamicRightsManagerException
user
- the user who wants to do the queryquery
- the query string
null
QueryEngineSyntaxException
- if the query string is syntactically incorrect
QueryEngineProcessingException
- the the query could not be processed (for example, due to logical errors in the query string)
QueryEngineException
- if any other error occurs
DynamicRightsManagerException
- if the user is not allowed to execute free queries in the query languageDynamicRightsManager.mayQuery(User, String)
,
getQuerySyntaxName()
,
getQuerySyntaxURL()
,
getQuerySyntaxVersion()
public Topic getTopicById(User user, String id) throws QueryEngineException
user
- the user who wants to get the topicid
- the topic's id
null
if the id does not exist
QueryEngineException
- if the topic could not be readDynamicRightsManager.mayViewTopic(User, Topic)
public Collection getTopics(User user) throws QueryEngineException
user
- the user who wants to get the topics
null
QueryEngineException
- if the topics could not be readTopic
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getTopicsByBeginning(User user, String beginning) throws QueryEngineException
user
- the user who wants to get the topicsbeginning
- the required beginning of a topic name; null
or the empty string match all topics
null
QueryEngineException
- if the topics could not be readTopic
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getTopicsBySubstring(User user, String substring, boolean searchComment) throws QueryEngineException
user
- the user who wants to get the topicssubstring
- the required substring of a topic name or comment; null
or the empty string match all topicssearchComment
- if true
, the comments are searched for the substring, too, otherwise only the topic name is searched
null
QueryEngineException
- if the topics could not be readTopic
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getClassTopics(User user) throws QueryEngineException
user
- the user who wants to get the topics
null
QueryEngineException
- if the topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getClassTopicsByBeginning(User user, String beginning) throws QueryEngineException
user
- the user who wants to get the topicsbeginning
- the required beginning of a topic name; null
or the empty string match all class topics
null
QueryEngineException
- if the topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getClassTopicsBySubstring(User user, String substring, boolean searchComment) throws QueryEngineException
user
- the user who wants to get the topicssubstring
- the required substring of a topic name or comment; null
or the empty string match all class topicssearchComment
- if true
, the comments are searched for the substring, too, otherwise only the topic name is searched
null
QueryEngineException
- if the topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getInstanceTopics(User user) throws QueryEngineException
user
- the user who wants to get the topics
null
QueryEngineException
- if the topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getInstanceTopicsByBeginning(User user, String beginning) throws QueryEngineException
user
- the user who wants to get the topicsbeginning
- the required beginning of a topic name; null
or the empty string match all non-class topics
null
QueryEngineException
- if the topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getInstanceTopicsBySubstring(User user, String substring, boolean searchComment) throws QueryEngineException
user
- the user who wants to get the topicssubstring
- the required substring of a topic name or comment; null
or the empty string match all non-class topicssearchComment
- if true
, the comments are searched for the substring, too, otherwise only the topic name is searched
null
QueryEngineException
- if the topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getTypes(User user, Topic topic) throws QueryEngineException
user
- the user who wants to get the typestopic
- the instance topic for which the types are returned
null
QueryEngineException
- if the types could not be readTypeInstance
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getInstances(User user, Topic topic) throws QueryEngineException
user
- the user who wants to get the instancestopic
- the type topic for which the instances are returned
null
QueryEngineException
- if the instances could not be readTypeInstance
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getInstanceRoots(User user) throws QueryEngineException
user
- the user who wants to get the root instance topics
null
QueryEngineException
- if the root instance topics could not be readTopic
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getSuperclasses(User user, Topic topic) throws QueryEngineException
If the implementation does not support classes, an empty collection is returned.
user
- the user who wants to get the superclassestopic
- the class topic for which the superclasses are returned
null
QueryEngineException
- if the superclasses could not be readSuperSubclass
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getSubclasses(User user, Topic topic) throws QueryEngineException
If the implementation does not support classes, an empty collection is returned.
user
- the user who wants to get the subclassestopic
- the class topic for which the subclasses are returned
null
QueryEngineException
- if the subclasses could not be readSuperSubclass
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Collection getClassRoots(User user) throws QueryEngineException
If the implementation does not support classes, an empty collection is returned.
user
- the user who wants to get the root class topics
null
QueryEngineException
- if the root class topics could not be readTopic
,
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Association getAssociationById(User user, String id) throws QueryEngineException
user
- the user who wants to get the associationid
- the association's id
null
if the id does not exist
QueryEngineException
- if the association could not be readDynamicRightsManager.mayViewAssociation(User, Association)
public Collection getAssociations(User user, Topic topic) throws QueryEngineException
user
- the user who wants to get the associationstopic
- the topic that is player in all returned associations
null
QueryEngineException
- if the associations could not be readAssociation
,
DynamicRightsManager.mayViewAssociation(User, Association)
public Collection getAssociationsOfType(User user, Topic type) throws QueryEngineException
user
- the user who wants to get the associationstype
- the type of all returned associations, including null
for typeless associations
null
QueryEngineException
- if the associations could not be readAssociation
,
DynamicRightsManager.mayViewAssociation(User, Association)
public Collection getAssociationRoles(User user, Association assoc) throws QueryEngineException
user
- the user who wants to get the association rolesassoc
- the association for which the roles are returned
null
QueryEngineException
- if the association roles could not be readAssociationRole
,
DynamicRightsManager.mayViewTopic(User, Topic)
public Concept getConceptById(User user, String id) throws QueryEngineException
user
- the user who wants to get the conceptid
- the concept's id
null
if the id does not exist
QueryEngineException
- if the concept could not be readDynamicRightsManager.mayViewTopic(User, Topic)
,
DynamicRightsManager.mayViewAssociation(User, Association)
,
DynamicRightsManager.mayViewAttribute(User, Attribute)
public int getTopicCount(User user)
user
- the user who wants to read the number of topics
DynamicRightsManager.mayViewTopic(User, Topic)
public int getClassTopicCount(User user)
user
- the user who wants to read the number of class topics
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public int getInstanceTopicCount(User user)
user
- the user who wants to read the number of non-class topics
Topic.isClassTopic()
,
DynamicRightsManager.mayViewTopic(User, Topic)
public int getAssociationCount(User user)
user
- the user who wants to read the number of associations
DynamicRightsManager.mayViewAssociation(User, Association)
public String getVersion()
public String getQuerySyntaxName()
getQuerySyntaxVersion()
,
executeQuery(User, String)
public String getQuerySyntaxVersion()
getQuerySyntaxName()
,
executeQuery(User, String)
public String getQuerySyntaxURL()
executeQuery(User, String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |