Package org.wymiwyg.rdf.graphs

Examples of org.wymiwyg.rdf.graphs.Triple


   */
  public static Map<Node, Node> getValidMapping(Graph g1, Graph g2) {
    // maps a triple-pattern to Collection[2]
    Map<TrivialTriplePattern, Set[]> patternTripleMap = new HashMap<TrivialTriplePattern, Set[]>();
    for (Iterator iter = g1.iterator(); iter.hasNext();) {
      Triple current = (Triple) iter.next();
      TrivialTriplePattern pattern = new TrivialTriplePattern(current);
      Set[] matchings = patternTripleMap.get(pattern);
      if (matchings == null) {
        matchings = new HashSet[2];
        matchings[0] = new HashSet();
        matchings[1] = new HashSet();
        patternTripleMap.put(pattern, matchings);
      }
      matchings[0].add(current);
    }
    for (Iterator iter = g2.iterator(); iter.hasNext();) {
      Triple current = (Triple) iter.next();
      TrivialTriplePattern pattern = new TrivialTriplePattern(current);
      Set[] matchings = patternTripleMap.get(pattern);
      if (matchings == null) {
        continue;
      }
View Full Code Here

TOP

Related Classes of org.wymiwyg.rdf.graphs.Triple

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.