|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fuberlin.wiwiss.semmf.engine.MatchingEngine
public class MatchingEngine
Given a MatchingDescription this class performs semantic matching between a query graph and a set of resource graphs.
Nested Class Summary | |
---|---|
private class |
MatchingEngine.QueryCluster
|
private class |
MatchingEngine.QueryGraph
|
private class |
MatchingEngine.QueryNode
A certain Node matching a particular pathExpr from a NodeMatchingDescription NOTE: There might be multiple QueryNodes matching the same pathExpr |
private class |
MatchingEngine.QueryProperty
|
Field Summary | |
---|---|
private GraphMatchingDescription |
gmd
A MatchingDescription object containing all matching information based on which the engine performs the matching of a query graph against a set of resource graphs. |
private MatchingEngine.QueryGraph |
queryGraph
This object stores all information from the query graph needed while matching against each resource graph. |
private com.hp.hpl.jena.rdf.model.Model |
queryModel
Reference to the Jena Model holding the query graph |
private com.hp.hpl.jena.rdf.model.Model |
resModel
Reference to the Jena Model holding all resource graphs |
Constructor Summary | |
---|---|
private |
MatchingEngine(GraphMatchingDescription gmd)
Constructor. |
|
MatchingEngine(java.lang.String mdURL)
Constructor |
|
MatchingEngine(java.lang.String mdURL,
java.lang.String lang)
Constructor |
Method Summary | |
---|---|
MatchingResult |
exec()
Executes the matching. |
private java.util.List |
findNodes(com.hp.hpl.jena.rdf.model.Model m,
java.lang.String pathExpr)
This method searches inside the Model m for RDFNodes matching the given RDQL path expression. |
private java.util.List |
findQueryNodes(java.lang.String pathExpr)
Searches inside a query model for RDFNodes matching the given path expression |
private java.util.List |
findResGraphEntries(java.lang.String pathExpr)
|
private java.util.List |
findResNodes(java.lang.String pathExpr,
java.lang.String resGraphEntryURI)
Searches inside a resource model for RDFNodes matching the given pathexpression |
private java.lang.String |
generateRDQLstring(java.lang.String pathExpr)
Given a path expression this method generates a full RDQL query string. |
private com.hp.hpl.jena.rdf.model.RDFNode |
getPropertyValue(com.hp.hpl.jena.rdf.model.Model m,
com.hp.hpl.jena.rdf.model.Resource r,
java.lang.String propURI)
This method is used to retrieve the value of a property of a given node (RDF resource). |
private MatchingEngine.QueryGraph |
loadQueryGraph(GraphMatchingDescription gmd)
This method loads all values from the query graph into memory and stores them using instances of the helper classes. |
private void |
recalcClusterResult(ClusterMatchingResultImpl cmr,
float weight)
If a certain node has to be matched in a reversed manner and it so happens that not every resource graph contains this particular node than the weight of this node inside this cluster has to be redistributed over the remaining nodes with respect to their relative weights. |
private static java.lang.String |
replaceAll(java.lang.String s,
java.lang.String token,
java.lang.String replacement)
Replaces all occurances of a substring (token) inside an inputString |
private java.lang.String |
replaceGraphEntryPlaceholder(java.lang.String pathExpr,
java.lang.String graphEntryURI)
The general path expressions for resource nodes from a matching description contain a placeholder for the graph entry, which is replaced by this method with a particular graph entry URI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private com.hp.hpl.jena.rdf.model.Model queryModel
private com.hp.hpl.jena.rdf.model.Model resModel
private GraphMatchingDescription gmd
private MatchingEngine.QueryGraph queryGraph
Constructor Detail |
---|
public MatchingEngine(java.lang.String mdURL)
mdURL
- location of the matching description in RDF/XML formatpublic MatchingEngine(java.lang.String mdURL, java.lang.String lang)
mdURL
- location of the matching descriptionlang
- serialization format of the matching description. Allowed values
"RDF/XML", "N3", "N-TRIPLE".private MatchingEngine(GraphMatchingDescription gmd)
gmd
- object representing a matching descriptionMethod Detail |
---|
public MatchingResult exec()
private MatchingEngine.QueryGraph loadQueryGraph(GraphMatchingDescription gmd)
gmd
- GraphMatchingDescription
private java.util.List findResGraphEntries(java.lang.String pathExpr)
pathExpr
- path expression
private java.util.List findQueryNodes(java.lang.String pathExpr)
pathExpr
- RDQL path expression
private java.util.List findResNodes(java.lang.String pathExpr, java.lang.String resGraphEntryURI)
pathExpr
- RDQL path expressionresGraphEntryURI
- URI of the entry node of a particular resource graph *
private java.util.List findNodes(com.hp.hpl.jena.rdf.model.Model m, java.lang.String pathExpr)
m
- RDFModel on which the RDQL query is performedpathExpr
- RDQL path expression
private com.hp.hpl.jena.rdf.model.RDFNode getPropertyValue(com.hp.hpl.jena.rdf.model.Model m, com.hp.hpl.jena.rdf.model.Resource r, java.lang.String propURI)
m
- Jena model in which the resource occursr
- Jena Resource objectpropURI
- URI of the property
private java.lang.String generateRDQLstring(java.lang.String pathExpr)
pathExpr
- path expression
private java.lang.String replaceGraphEntryPlaceholder(java.lang.String pathExpr, java.lang.String graphEntryURI)
pathExpr
- path expressiongraphEntryURI
- URI of the node which is the entry of the resource graph
private void recalcClusterResult(ClusterMatchingResultImpl cmr, float weight)
cmr
- ClusterMatchingResult to be recalculatedweight
- accumulated weight to be redistrubutedprivate static java.lang.String replaceAll(java.lang.String s, java.lang.String token, java.lang.String replacement)
s
- original stringtoken
- String token to be replacedreplacement
- String to replace the given token
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |