Thanks a lot for this Rupert!

alessandro


On 6/12/12 10:12 AM, Rupert Westenthaler wrote:
Hi

Since STANBOL-580 it is possible to register Clerezza RDF graphs with
the Stanbol SPARQL endpoint. While this is currently only used by the
Stanbol Contenthub it might be of general interest to Stanbol users.

Here is how it works ...

     //you need a BundleContext
     BundleContext bundleContext;

     //and the Clerezza Graph you want to publish
     TripleCollection graph;

      //define the metadata for the registration
     Dictionary<String,Object>  properties = new Hashtable<String,Object>();
     properties.put("graph.uri", "http://my.graph.com";); //required
     properties.put("graph.name","My graph");
     properties.put("graph.description", "Just a How to register a
graph with the SPARQL endpoint");

     //use service.rankings to specify the default search graph
     //Integer.MAX_VALUE ensures this will be the default search graph
     properties.put("service.ranking", Integer.MAX_VALUE);

     //Now use your BundleContext to register the graph
     ServiceRegistration registration =
bundleContext.registerService(TripleCollection.class.getName(), graph,
properties);

     //unrigster if you no longer need the graph
     registration.unregister();


If you registered your graph you can access it via

     http://{host}:{port}/{stanbol-path}/sparql

See also STANBOL-580 [1] for details.

best
Rupert

[1] https://issues.apache.org/jira/browse/STANBOL-580



--
M.Sc. Alessandro Adamou

Alma Mater Studiorum - Università di Bologna
Department of Computer Science
Mura Anteo Zamboni 7, 40127 Bologna - Italy

Semantic Technology Laboratory (STLab)
Institute for Cognitive Science and Technology (ISTC)
National Research Council (CNR)
Via Nomentana 56, 00161 Rome - Italy


"I will give you everything, just don't demand anything."
(Ettore Petrolini, 1917)

Not sent from my iSnobTechDevice

Reply via email to