Skip to end of metadata
Go to start of metadata

In the default configuration, KIM comes with a working gazetteer, which loads its dictionaries using a SPARQL query over our RDF data. In the general case, making the gazetteer use the new entities is just a matter of changing the query, contained in KIM/config/query.txt . The DBpedia case, however, is a little bit more complex, due to the complexity of the ontology (rich vertical structure). Therefore, we suggest that you setup a new gazetteer for each major class of objects you want to recognize.

First, construct the query to load the gazetteer lists:

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix protont: <http://proton.semanticweb.org/2006/05/protont#>
PREFIX protons: <http://proton.semanticweb.org/2006/05/protons#>


SELECT ?la ?entity ?cl
WHERE \
   ?entity a ?cl ;
           rdfs:label ?la ;
           protons:generatedBy <http://dbpedia.org/page/DBpedia> .
   ?cl rdfs:subClassOf protont:Person .
   OPTIONAL
   \{
       ?sc rdfs:subClassOf ?cl.
       ?entity a ?sc .
       filter(?cl != ?sc)      
   \}
   filter (!bound(?sc) && isURI (?cl))
   \}

It will return a list of all instances of class protont:Person and its subclasses. The dbpedia:Person is its subclass, so it will be included in the results. The only requirement for the query is to return the label, the instance URI and the class URI, in this order.

When you create the query, you can use some tools to see the actual results that will be loaded in the gazetteer dictionary. Such tools are JVisualVM with the JConsole extension. Or a simple web service call like the one we describe in the documentation:

http://www.ontotext.com/kim/getting-started/documentation (WSAPI section)

Create the folder }KIM/context/default/resources/gazetteer/dbpedia-person and put the query in a file named query.txt there.

Clear the caches.

Whenever you make some changes that concern the ontology, you should remove the OWLIM image by deleting KIM/context/default/populated. When you start KIM again, it will generate a fresh image.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.