Posts Tagged ‘freetext’

Semantic Progress

February 12, 2010 Comments off

Now have inference working with a basic ontology for LewisT.

select * {

?s rdf:type geonames:Feature


returns all Location class individuals, as Location is owl:subClass geonames:Feature

Needs a hefty machine – ram and cpu.

Have created an ontology

Have updated the RDF and ontology to use restrictions and intermediate classes (object properties) to model compound sub properties etc. This has also meant removing the # identification of properties and having classnames in URIs. Some of the Sparql gets more verbose in this case, eg.

Adminregions which are different than the location names in which they exist.

SELECT ?s ?sname ?o ?oname
 ?s foaf:name ?sname .
 ?s lew:adminregion ?o .
 ?o lew:placename ?n .
 ?n foaf:name ?oname .
 filter (?sname != ?oname )

So now have

  • LoD RDF Dataset
  • Sparql endpoint
  • Ontology
  • Lucene based text search on Literals, via sparql :

    – find places with Kill in the name, their county and province

    SELECT ?place ?pr ?ad
     ?lit apf:textMatch '+KILL*' .
     ?place ?p ?lit .
     ?place foaf:name ?n .
     ?place lew:County ?ad .
     ?place lew:Province ?pr
  • Facets (via group by and count – perhaps SOLR can still do a better/easier job here) eg
SELECT ?pr count(?pr)

 ?lit apf:textMatch '+KILL*' .
 ?place ?p ?lit .
 ?place foaf:name ?n .
 ?place lew:Province ?pr .

group by ?pr


Semantic Progress

January 29, 2010 2 comments

Got lucene search function working in Jena finally, having figured out where my bugs were. Now possible to freetext search literals and get back RDF of subject referring to that literal, or any other construct

At do this :

PREFIX rdf:<>
PREFIX owl: <>
PREFIX muo: <>
PREFIX lew: <>
PREFIX dc: <>
PREFIX geonames: <>
PREFIX dbpedia: <>
PREFIX xsd: <>
PREFIX rdfs: <>
PREFIX ucum: <>
PREFIX wgs84: <>
PREFIX foaf: <>
PREFIX list: <>
PREFIX apf: <>
CONSTRUCT { ?s ?prop ?lit }
WHERE { ?lit apf:textMatch '+"Board of First Fruits"' . 
 ?doc ?p ?lit .
 ?s ?prop ?doc

Next steps are to create my own extension function to search across both ontology and text, and group results.