diff --git a/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/bin/de/tudarmstadt/ke/sw/matching/MyMatcher.class b/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/bin/de/tudarmstadt/ke/sw/matching/MyMatcher.class index 1cca1732..53dba7dc 100644 Binary files a/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/bin/de/tudarmstadt/ke/sw/matching/MyMatcher.class and b/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/bin/de/tudarmstadt/ke/sw/matching/MyMatcher.class differ diff --git a/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/src/de/tudarmstadt/ke/sw/matching/MyMatcher.java b/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/src/de/tudarmstadt/ke/sw/matching/MyMatcher.java index 2c6c6b6d..4adc33c8 100755 --- a/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/src/de/tudarmstadt/ke/sw/matching/MyMatcher.java +++ b/ws2011/Semantic Web/Uebungen/2. Bonus Aufgabe/MatchingExample/src/de/tudarmstadt/ke/sw/matching/MyMatcher.java @@ -1,5 +1,10 @@ package de.tudarmstadt.ke.sw.matching; +//TODO: luffŠhiges Programm (2 Pkt.) +// ein strukturbasiertes Verfahren (1 Pkt.), +// ein externes oder semantisches Verfahren (1 Pkt.) +// -> Tests mit Benchmarks und Doku (1 Pkt.) + import java.io.File; import java.net.URI; @@ -14,9 +19,12 @@ import org.semanticweb.owl.align.AlignmentProcess; import org.semanticweb.owl.align.Cell; import org.semanticweb.owl.align.Evaluator; +import com.hp.hpl.jena.graph.Graph; +import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.rdf.model.ModelFactory; +import com.hp.hpl.jena.rdf.model.ModelGraphInterface; import com.hp.hpl.jena.util.iterator.ExtendedIterator; import fr.inrialpes.exmo.align.impl.BasicAlignment; @@ -30,7 +38,7 @@ public class MyMatcher extends BasicAlignment implements AlignmentProcess { private URI uri1; private URI uri2; - + @Override public void init(Object arg0, Object arg1) throws AlignmentException { uri1 = (URI) arg0; @@ -47,6 +55,18 @@ public class MyMatcher extends BasicAlignment implements AlignmentProcess { OntModel onto2 = ModelFactory.createOntologyModel(); onto2.read(uri2.toString()); + Graph graph1 = onto2.getGraph(); + Graph graph2 = onto2.getGraph(); + + + boolean iso = graph1.isIsomorphicWith(graph2); + System.out.println(iso); + + + int size1 = graph1.size(); + System.out.println(size1); + + // key: name // value: uri HashMap classNames1 = new HashMap(); @@ -68,6 +88,8 @@ public class MyMatcher extends BasicAlignment implements AlignmentProcess { } + + public static void main(String[] args) throws AlignmentException { String testCase = "103";