From 704fb3cd2a5e7079bdf1ad935af65da35feca8d6 Mon Sep 17 00:00:00 2001 From: Dimitris Kontokostas Date: Fri, 24 Apr 2015 20:27:34 +0300 Subject: [PATCH] exclude current type for inferred --- .../extraction/mappings/wikidata/WikidataR2RExtractor.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/dbpedia/extraction/mappings/wikidata/WikidataR2RExtractor.scala b/core/src/main/scala/org/dbpedia/extraction/mappings/wikidata/WikidataR2RExtractor.scala index 2eb0f076c2..be17336f46 100644 --- a/core/src/main/scala/org/dbpedia/extraction/mappings/wikidata/WikidataR2RExtractor.scala +++ b/core/src/main/scala/org/dbpedia/extraction/mappings/wikidata/WikidataR2RExtractor.scala @@ -227,7 +227,7 @@ class WikidataR2RExtractor( // Generate inferred types context.ontology.classes.get(q.value.replace("http://dbpedia.org/ontology/", "")) match { case Some(clazz) => - for (cls <- clazz.relatedClasses) + for (cls <- clazz.relatedClasses.filter(_ != clazz)) adjustedGraph += new Quad(context.language, DBpediaDatasets.OntologyTypesTransitive, subjectUri, rdfType, cls.uri, page.wikiPage.sourceUri) case None => }