Class SMOntologyAggWeightedImpl
java.lang.Object
de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
de.uni_trier.wi2.procake.similarity.base.ontology.impl.SMOntologyImpl
de.uni_trier.wi2.procake.similarity.base.ontology.aggregate.impl.SMOntologyAggWeightedImpl
- All Implemented Interfaces:
SMOntologyAggWeighted
,SMOntology
,SimilarityMeasure
- Direct Known Subclasses:
SMOntologyAggAvgImpl
,SMOntologyAggMinImpl
public abstract class SMOntologyAggWeightedImpl
extends SMOntologyImpl
implements SMOntologyAggWeighted
A description of the measure can be found in
SMOntologyAggWeighted
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
LOG_ORDER_NAME_NOT_FOUND
Fields inherited from interface de.uni_trier.wi2.procake.similarity.base.ontology.aggregate.SMOntologyAggWeighted
DEFAULT_IGNORE_MISSING_RELATIONS_IN_QUERY, DEFAULT_WEIGHT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected DataObject
createDataObjectFromLiteral
(org.apache.jena.rdf.model.Literal literal) Create a matching AtomicObject for a given Literal from the ontology.double
getNormalizedRelationWeights
(Map<String, List<org.apache.jena.rdf.model.RDFNode>> queryResources) Normalize the defined weights to a sum of 1.0.getRelevantResources
(org.apache.jena.rdf.model.Resource resource, Ontology ontology) boolean
void
setDefaultWeight
(double defaultWeight) void
setIgnoreMissingRelationsInQuery
(boolean ignoreMissingRelationsInQuery) void
setInferredRelation
(String relationName, String relationQuery, String relationQueryParamName, String simMeasure, double weight) void
setRelation
(String relationName, String simMeasure, Double weight) protected boolean
validLiteralDataClass
(DataClass dataClass) Check if is is a valid DataClass (Numeric or String).Methods inherited from class de.uni_trier.wi2.procake.similarity.base.ontology.impl.SMOntologyImpl
checkArgumentApplicability, checkInstanceOntologyOrderPredicate, isSimilarityFor, validateNonNull, validateOntologyMatching, validateOntologyResource
Methods inherited from class de.uni_trier.wi2.procake.similarity.impl.SimilarityMeasureImpl
getDataClass, getName, initialize, initializeBasedOn, isAggregate, isForceOverride, isInterval, isNumeric, isObject, isReusable, isSet, isTable, isTaxonomy, isText, setDataClass, setForceOverride, setName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.similarity.SimilarityMeasure
compute, getDataClass, getName, getSystemName, isForceOverride, isReusable, setForceOverride
Methods inherited from interface de.uni_trier.wi2.procake.similarity.base.ontology.SMOntology
checkArgumentApplicability, checkInstanceOntologyOrderPredicate
-
Field Details
-
relationCache
-
-
Constructor Details
-
SMOntologyAggWeightedImpl
public SMOntologyAggWeightedImpl()
-
-
Method Details
-
getRelevantResources
-
getNormalizedRelationWeights
protected Map<String,Double> getNormalizedRelationWeights(Map<String, List<org.apache.jena.rdf.model.RDFNode>> queryResources) Normalize the defined weights to a sum of 1.0.- Returns:
- the normalized weights.
-
createDataObjectFromLiteral
Create a matching AtomicObject for a given Literal from the ontology.- Parameters:
literal
- from the ontology with an DataValue.- Returns:
- the matching AtomicObject.
-
validLiteralDataClass
Check if is is a valid DataClass (Numeric or String).- Parameters:
dataClass
- the given DataClass.- Returns:
- if it is valid.
-
setRelation
- Specified by:
setRelation
in interfaceSMOntologyAggWeighted
- Parameters:
relationName
- name of the relation to be inferredsimMeasure
- similarity measure to be usedweight
- weight of the relation
-
setInferredRelation
public void setInferredRelation(String relationName, String relationQuery, String relationQueryParamName, String simMeasure, double weight) - Specified by:
setInferredRelation
in interfaceSMOntologyAggWeighted
- Parameters:
relationName
- name of the relation to be inferredrelationQuery
- SPARQL stringrelationQueryParamName
- name of the parameter used in relationQuerysimMeasure
- similarity measure to be usedweight
- weight of the relation
-
getRelations
- Specified by:
getRelations
in interfaceSMOntologyAggWeighted
- Returns:
- map with all registered relations and corresponding weight and similarity measure
-
getDefaultWeight
public double getDefaultWeight()- Specified by:
getDefaultWeight
in interfaceSMOntologyAggWeighted
- Returns:
- default weight
-
setDefaultWeight
public void setDefaultWeight(double defaultWeight) - Specified by:
setDefaultWeight
in interfaceSMOntologyAggWeighted
- Parameters:
defaultWeight
- is the default weight for each relation, which hasn't an own weight
-
isIgnoreMissingRelationsInQuery
public boolean isIgnoreMissingRelationsInQuery()- Specified by:
isIgnoreMissingRelationsInQuery
in interfaceSMOntologyAggWeighted
-
setIgnoreMissingRelationsInQuery
public void setIgnoreMissingRelationsInQuery(boolean ignoreMissingRelationsInQuery) - Specified by:
setIgnoreMissingRelationsInQuery
in interfaceSMOntologyAggWeighted
-