Skip to content

Commit

Permalink
class extractor uses template with most attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-h committed Mar 8, 2019
1 parent 6ccc69b commit e8a83a0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,22 @@ class ArticleTemplatesClassExtractor(
if(templateNodes.isEmpty){
quads += new Quad(context.language, DBpediaDatasets.TemplateType, subjectUri, typeProperty, owlThing, node.sourceIri)
}else{
var templateClassUri = context.language.dbpediaUri + "/class/" + templateNodes.head.title.encoded.toLowerCase
var selectedTemplateNode = templateNodes.sortBy(_.children.length).last

var templateClassUri = context.language.dbpediaUri + "/class/" + selectedTemplateNode.title.encoded.toLowerCase

quads += new Quad(context.language, DBpediaDatasets.TemplateType, subjectUri, typeProperty, templateClassUri, node.sourceIri)

seenClasses.synchronized {
if (!seenClasses.contains(templateClassUri)) {
var classLabel = templateNodes.head.title.decoded
var classLabel = selectedTemplateNode.title.decoded
classLabel = stripAll(classLabel, " _-")
seenClasses += templateClassUri
quads += new Quad(context.language, DBpediaDatasets.TemplateTypeDefinitions, templateClassUri, typeProperty, owlClass, node.sourceIri)
quads += new Quad(context.language, DBpediaDatasets.TemplateTypeDefinitions, templateClassUri, labelProperty, classLabel, node.sourceIri, rdfLangStrDt)
}
}
}

}
quads
}
Expand Down

0 comments on commit e8a83a0

Please sign in to comment.