Enum ConceptType
java.lang.Object
java.lang.Enum<ConceptType>
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.filter.ConceptType
- All Implemented Interfaces:
Serializable
,Comparable<ConceptType>
,java.lang.constant.Constable
This enum represents different resource types that may occur in an ontology.
In addition, it offers services to determine the resource type given a model and a URI.
- Author:
- Sven Hertling, Jan Portisch
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
Modifier and TypeFieldDescriptionprivate static org.apache.jena.graph.Node[]
private static final org.slf4j.Logger
Default Loggerprivate static org.apache.jena.graph.Node[]
private static org.apache.jena.graph.Node[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static Set<org.apache.jena.graph.Node>
allTypes
(org.apache.jena.graph.Node n, org.apache.jena.graph.Graph g) static ConceptType
Returns the most precise/specific resource type.static ConceptType
analyzeWithInference
(org.apache.jena.rdf.model.InfModel model, String resourceURI) Anlyze the type of the resource.static ConceptType
analyzeWithJena
(org.apache.jena.ontology.OntModel model, String resourceURI) Returns the most precise/specific resource type.private static boolean
intersect
(Set<org.apache.jena.graph.Node> prefetchedTypes, org.apache.jena.graph.Node[] requestedTypes) static ConceptType
subsumeProperties
(ConceptType resourceType) This method returns only CLASS, RDF_PROPERTY, INSTANCE or UNKNOWN and, thus, subsumes all different property types like DATATYPE_PROPERTY, OBJECT_PROPERTY, ANNOTATION_PROPERTY, and RDF_PROPERTY.static ConceptType
Returns the enum constant of this type with the specified name.static ConceptType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CLASS
-
RDF_PROPERTY
-
DATATYPE_PROPERTY
-
OBJECT_PROPERTY
-
ANNOTATION_PROPERTY
-
INSTANCE
-
UNKNOWN
-
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGERDefault Logger -
classTypes
private static org.apache.jena.graph.Node[] classTypes -
objectPropertyTypes
private static org.apache.jena.graph.Node[] objectPropertyTypes -
rdfPropertyTypes
private static org.apache.jena.graph.Node[] rdfPropertyTypes
-
-
Constructor Details
-
ConceptType
private ConceptType()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
analyze
Returns the most precise/specific resource type. This method implements its own simplistic reasoning for determining the type of the resource. For more sophisticated reasoning useanalyzeWithInference(InfModel, String)
} .- Parameters:
model
- any modelresourceURI
- The URI for which the resource type shall be determined.- Returns:
- The most specify resource type available (like ObjectProperty)
-
allTypes
private static Set<org.apache.jena.graph.Node> allTypes(org.apache.jena.graph.Node n, org.apache.jena.graph.Graph g) -
intersect
private static boolean intersect(Set<org.apache.jena.graph.Node> prefetchedTypes, org.apache.jena.graph.Node[] requestedTypes) -
analyzeWithJena
public static ConceptType analyzeWithJena(org.apache.jena.ontology.OntModel model, String resourceURI) Returns the most precise/specific resource type. This method implements the jena way of determmin the concept type. Without inference, it may yield not perfect result and is usually slower thananalyze(org.apache.jena.rdf.model.Model, java.lang.String)
.- Parameters:
model
- any ont modelresourceURI
- The URI for which the resource type shall be determined.- Returns:
- The most specify resource type available (like ObjectProperty)
-
analyzeWithInference
public static ConceptType analyzeWithInference(org.apache.jena.rdf.model.InfModel model, String resourceURI) Anlyze the type of the resource. This heavily depends on the attached reasoner. To have same good results, use at least an rdfs reasoner.- Parameters:
model
- any modelresourceURI
- The URI for which the resource type shall be determined.- Returns:
- The resource category of the URI in question.
-
subsumeProperties
This method returns only CLASS, RDF_PROPERTY, INSTANCE or UNKNOWN and, thus, subsumes all different property types like DATATYPE_PROPERTY, OBJECT_PROPERTY, ANNOTATION_PROPERTY, and RDF_PROPERTY.- Parameters:
resourceType
- The resource type for which the parent shall be returned.- Returns:
- The parent type. If there is no parent, the resource type itself will be returned.
-