Archive

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



Advertisements

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 http://uoccou.endofinternet.net:2020/lewist.html do this :

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX muo: <http://purl.oclc.org/NET/muo/muo#>
PREFIX lew: <http://purl.org/uoccou/lewist/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX geonames: <http://www.geonames.org/ontology#>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ucum: <http://purl.oclc.org/NET/muo/ucum/unit/length/>
PREFIX wgs84: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX list: <http://jena.hpl.hp.com/ARQ/list#>
PREFIX apf: <http://jena.hpl.hp.com/ARQ/property#>
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.