re On Wed, May 11, 2011 at 05:44:08PM +0100, Andy Seaborne wrote: > However, the locking works in other situations - could the same TDB > daatbase be shared between services in some way?
Yes. The dataset has a SPARQL and an update service. Is it possible to configure a service that can do both ? > What's the joseki > config file? # This file is written in N3 / Turtle @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix module: <http://joseki.org/2003/06/module#> . @prefix joseki: <http://joseki.org/2005/06/configuration#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . ## -------------------------------------------------------------- ## This file is written in N3 / Turtle ## It is an RDF graph - order of RDF triples does not matter ## to the machine but it does help people who need to edit this file. ## Note: web.xml must be in-step with this file. ## for each service, ## Note: adding rdfs:label to blank nodes will cause Joseki ## to print that in log messages. ## See also file:joseki-config-example.ttl ## -------------------------------------------------------------- ## About this configuration <> rdfs:label "Joseki Configuration File" . ## -------------------------------------------------------------- ## About this server <#server> rdf:type joseki:Server ; # Example of some initialization code. joseki:initialization [ module:implementation [ module:className <java:org.joseki.util.ServiceInitSimple> ; rdfs:label "Example initializer" ; ] ] ; . ## -------------------------------------------------------------- ## Services ## Services are the points that request are sent to. ## serviceRef that will be used to match requests to services, ## not some resource URI for the description. ## Note that the service reference and the routing of incoming ## requests by URI as defined by web.xml have to align. # Service 1 # General purpose SPARQL processor, no dataset, expects the # request to specify the dataset (either by parameters in the # protocol request or in the query itself). <#service1> rdf:type joseki:Service ; rdfs:label "service point" ; joseki:serviceRef "sparql" ; # web.xml must route this name to Joseki joseki:processor joseki:ProcessorSPARQL ; . <#service2> rdf:type joseki:Service ; rdfs:label "Update on the foaf model" ; joseki:serviceRef "foafupdate" ; # web.xml must route this name to Joseki # dataset part joseki:dataset <#foaf> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. # joseki:processor joseki:ProcessorSPARQL_FixedDS ; joseki:processor joseki:ProcessorSPARQLUpdate ; . <#service3> rdf:type joseki:Service ; rdfs:label "SPARQL on the foaf model" ; joseki:serviceRef "foaf" ; # web.xml must route this name to Joseki # dataset part joseki:dataset <#foaf> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. joseki:processor joseki:ProcessorSPARQL_FixedDS ; . <#service4> rdf:type joseki:Service ; rdfs:label "Update on the crawl model" ; joseki:serviceRef "crawlupdate" ; # web.xml must route this name # dataset part joseki:dataset <#crawl> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. # joseki:processor joseki:ProcessorSPARQL_FixedDS ; joseki:processor joseki:ProcessorSPARQLUpdate ; . <#service5> rdf:type joseki:Service ; rdfs:label "SPARQL on the crawl model" ; joseki:serviceRef "crawl"; # web.xml must route this name to Joseki # dataset part joseki:dataset <#crawl> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. joseki:processor joseki:ProcessorSPARQL_FixedDS ; . <#service6> rdf:type joseki:Service ; rdfs:label "Update on the ontology model" ; joseki:serviceRef "ontologyupdate" ; # web.xml must route this name # dataset part joseki:dataset <#ontology> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. # joseki:processor joseki:ProcessorSPARQL_FixedDS ; joseki:processor joseki:ProcessorSPARQLUpdate ; . <#service7> rdf:type joseki:Service ; rdfs:label "SPARQL on the ontology model" ; joseki:serviceRef "ontology"; # web.xml must route this name to Joseki # dataset part joseki:dataset <#ontology> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. joseki:processor joseki:ProcessorSPARQL_FixedDS ; . <#service8> rdf:type joseki:Service ; rdfs:label "SPARQL on the dbpedia model" ; joseki:serviceRef "dbpedia"; # web.xml must route this name to Joseki # dataset part joseki:dataset <#dbpedia> ; # Service part. # This processor will not allow either the protocol, # nor the query, to specify the dataset. joseki:processor joseki:ProcessorSPARQL_FixedDS ; . ## ---- SPARQL/Update ## A pair of services - one for SPARQL queries, one for SPARQL/Update ## Previous web.xml must also be updated to include a defintion for the ## servlet "SPARQL/Update service processor" and update requests must ## be routed to this servlet. ## <#serviceUpdate> ## rdf:type joseki:Service ; ## rdfs:label "SPARQL/Update" ; ## joseki:serviceRef "update/service" ; ## # dataset part ## joseki:dataset <#mem>; ## # Service part. ## # This processor will not allow either the protocol, ## # nor the query, to specify the dataset. ## joseki:processor joseki:ProcessorSPARQLUpdate ## . ## ## <#serviceRead> ## rdf:type joseki:Service ; ## rdfs:label "SPARQL" ; ## joseki:serviceRef "sparql/read" ; ## # dataset part ## joseki:dataset <#mem> ; ## Same dataset ## # Service part. ## # This processor will not allow either the protocol, ## # nor the query, to specify the dataset. ## joseki:processor joseki:ProcessorSPARQL_FixedDS ; ## . ## -------------------------------------------------------------- ## Datasets [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" . tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset . tdb:GraphTDB rdfs:subClassOf ja:Model . <#foaf> rdf:type tdb:DatasetTDB ; rdfs:label "foaf" ; tdb:location "foaf" ; . <#crawl> rdf:type tdb:DatasetTDB ; rdfs:label "crawl" ; tdb:location "crawl" ; . <#ontology> rdf:type tdb:DatasetTDB ; rdfs:label "ontology" ; tdb:location "ontology" ; . <#dbpedia> rdf:type tdb:DatasetTDB ; rdfs:label "dbpedia" ; tdb:location "dbpedia" ; . ## -------------------------------------------------------------- ## Processors joseki:ProcessorSPARQL rdfs:label "General SPARQL processor" ; rdf:type joseki:Processor ; module:implementation joseki:ImplSPARQL ; # Parameters - this processor processes FROM/FROM NAMED joseki:allowExplicitDataset "true"^^xsd:boolean ; joseki:allowWebLoading "true"^^xsd:boolean ; ## And has no locking policy (it loads data each time). ## The default is mutex (one request at a time) joseki:lockingPolicy joseki:lockingPolicyNone ; . joseki:ProcessorSPARQL_FixedDS rdfs:label "SPARQL processor for fixed datasets" ; rdf:type joseki:Processor ; module:implementation joseki:ImplSPARQL ; # This processor does not accept queries with FROM/FROM NAMED joseki:allowExplicitDataset "false"^^xsd:boolean ; joseki:allowWebLoading "false"^^xsd:boolean ; joseki:lockingPolicy joseki:lockingPolicyMRSW ; . joseki:ProcessorSPARQLUpdate rdfs:label "SPARQL Update processor" ; rdf:type joseki:Processor ; module:implementation joseki:ImplSPARQLUpdate ; joseki:lockingPolicy joseki:lockingPolicyMRSW ; . joseki:ImplSPARQL rdf:type joseki:ServiceImpl ; module:className <java:org.joseki.processors.SPARQL> . joseki:ImplSPARQLUpdate rdf:type joseki:ServiceImpl ; module:className <java:org.joseki.processors.SPARQLUpdate> . # Local Variables: # tab-width: 4 # indent-tabs-mode: nil # End: cu, brunni -- ++ Michael Brunnbauer ++ netEstate GmbH ++ Geisenhausener Straße 11a ++ 81379 München ++ Tel +49 89 32 19 77 80 ++ Fax +49 89 32 19 77 89 ++ E-Mail [email protected] ++ http://www.netestate.de/ ++ ++ Sitz: München, HRB Nr.142452 (Handelsregister B München) ++ USt-IdNr. DE221033342 ++ Geschäftsführer: Michael Brunnbauer, Franz Brunnbauer ++ Prokurist: Dipl. Kfm. (Univ.) Markus Hendel
