|
From: Bryan T. <br...@sy...> - 2011-07-13 14:54:04
|
Israel,
Here is another way to accomplish the same purpose. Modify line #605 of bigdataCluster16.config file:
old:
// properties = new NV[] {};
new:
properties = lubm.properties;
This will direct the NanoSparqlServer to use the configuration for the KB instance described the the "lubm" component in the file. You can then modify the "lubm" component to reflect your use case, e.g., triples versus quads, etc.
To setup for quads, change the following lines in the "lubm" configuration block:
old:
//new NV(BigdataSail.Options.AXIOMS_CLASS, "com.bigdata.rdf.axioms.RdfsAxioms"),
new:
new NV(BigdataSail.Options.AXIOMS_CLASS,"com.bigdata.rdf.axioms.NoAxioms"),
new:
new NV(BigdataSail.Options.QUADS_MODE,"true"),
old:
new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_INVERSE_OF, "true"),
new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_TRANSITIVE_PROPERTY, "true"),
new:
// new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_INVERSE_OF, "true"),
// new NV(BigdataSail.Options.FORWARD_CHAIN_OWL_TRANSITIVE_PROPERTY, "true"),
When you start the NanoSparqlServer you are giving it three arguments:
NanoSparqlServer port namespace configFile
The namespace will be created if it does not exist and it will use the properties from the "com.bigdata.rdf.sail.webapp.NanoSparqlServer" component block in the configuration file. Since you probably already have a KB instance named "kb", specify a different namespace this time around. E.g., "kb2".
Thanks,
Bryan
________________________________________
From: Bryan Thompson [br...@sy...]
Sent: Wednesday, July 13, 2011 9:53 AM
To: Isr...@th...; big...@li...
Subject: Re: [Bigdata-developers] using nanoSparqlServer with federation
Israel,
Here is what I think may be going on. I think that you are not explicitly creating a scale-out kb instance after you start the federation and before you start the NanoSparqlServer. If you look at the top of the log when you *first* started the NanoSparqlServer on the cluster, I think that you may see a line similar to the one below.
WARN : 4210 main com.bigdata.rdf.sail.webapp.BigdataRDFServletContextListener.contextInitialized(BigdataRDFServletContextListener.java:165): Creating KB instance: namespace=kb
This indicates that a KB instance was created for you using the properties configured for the BigdataClient for the NanoSparqlServer. However, those properties are amost certain to be incorrect in scale-out as they will be nearly entirely defaults (e.g., basically not specified) out of the box. (The situation is a bit different in the standalone WAR.) The default configuration will create a KB instance which uses some features that are not supported in scale-out, including backchainers for things like (s rdf:type rdfs:Resource). I suspect that there is something about the default configuration which is leading you to this class cast exception, but it would be helpful to have the full stack trace on that.
Normally people will bulk load some data into a cluster as a starting point. However, you are trying to get started through the NanoSparqlServer. So, you are going to need to create an appropriate KB instance and then specify the namespace of that KB instance when you start the NanoSparqlServer (along with the port and the configuration file used to connect to the cluster).
The bigdataCluster16.config (and the other sample cluster configuration files) all contain a section labeled "lubm" which defines a set of initialization properties which are used in conjuction with the MappedRDFDataLoadMaster to create a scale-out KB instance when the bulk loader is executed. The "lubm" section starts at ~ 1291 of the bigdataCluster16.config file. The setup for the bulk loader follows in the next component configuration block. You can look at the bulk loader code to see how it goes about creating a scale-out instance. The relevant code is ~ RDFMappedDataLoadMaster#952 (createTripleStore()). That method assumes that the named KB instance does not exist. Conditional logic for this can be found at line 892 (openTripleStore()). It should be pretty easy to create a simple utility class which will create the desired KB instance under program control or using properties specified in a Configuration file.
In general, you will need to edit the configuration blocks in order to specify appropriate configuration properties for the scale-out KB instance that you are trying to create. For example, are you intending to use triples or quads mode? All of that needs to get configured and an appropriate KB instance created which you can then connect to using the NanoSparqlServer and run your updates/queries against. I would recommend starting from the configuration block in the bigdataCluster16.config file since it "tweaks" several properties for a clustered KB instance.
I'll follow up off list with my contact information if you want to talk about this directly.
Thanks,
Bryan
________________________________________
From: Isr...@th... [Isr...@th...]
Sent: Wednesday, July 13, 2011 7:49 AM
To: Bryan Thompson
Subject: RE: using nanoSparqlServer with federation
Hi Bryan,
In which log should I expect to see the stack trace? I have changed the
root logger level to DEBUG in the log4j.properties file, but still all
the log files, except for the state.log are empty.
I did not use any program, I just used the poster plug-in in Firefox to
POST a URI.
Thanks,
Israel
-----Original Message-----
From: Bryan Thompson [mailto:br...@sy...]
Sent: Wednesday, July 13, 2011 2:26 PM
To: Klein, Israel; big...@li...
Subject: RE: using nanoSparqlServer with federation
Israel,
If you are having difficulties getting a full stack trace, can you send
a small program which exhibits the exception and I will look into it
this morning. I've tracked down the code change that I was thinking of,
which was to TimestampChooser, and it appears that the change there was
applied to both the release and the development branch so this is
something different. The BTree is the node-local mutable b+tree object.
The IClientIndex is a remote view of a sharded B+Tree. I'm not sure
where the class cast is coming from based on what is inline below, but
if you have the rest of the stack trace or can provide a small example I
will track this down.
Thanks,
bryan
________________________________________
From: Isr...@th... [Isr...@th...]
Sent: Wednesday, July 13, 2011 6:42 AM
To: big...@li...
Subject: [Bigdata-developers] FW: using nanoSparqlServer with federation
From: Klein, Israel
Sent: Wednesday, July 13, 2011 1:39 PM
To: 'big...@li...'
Subject: using nanoSparqlServer with federation
Hi,
I have installed a federation on 9 machines using the
bigdataCluster16.config example which seems to work fine (used the
latest BIGDATA_RELEASE_1_0_0 branch). Then I have started a
nanoSparqlServer.sh and I can access its /status and /counters URLs.
However, when I try to POST a new URI I get the following exception:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException: java.lang.ClassCastException:
com.bigdata.btree.BTree cannot be cast to
com.bigdata.service.ndx.IClientIndex</title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /sparql. Reason:
<pre> java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: java.util.concurrent.ExecutionException:
java.util.concurrent.ExecutionException: java.lang.ClassCastException:
com.bigdata.btree.BTree cannot be cast to
com.bigdata.service.ndx.IClientIndex</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
I use
http://[host]:[port]/[namespace]/sparql?uri=[a<http://[host]:[port]/%5bn
amespace%5d/sparql?uri=%5ba> url which returns an RDF in n3 format]
which works fine when using it on a nanoSparalServer war on a separate
Tomcat.
Thanks,
Israel
This email was sent to you by Thomson Reuters, the global news and
information company. Any views expressed in this message are those of
the individual sender, except where the sender specifically states them
to be the views of Thomson Reuters.
This email was sent to you by Thomson Reuters, the global news and information company. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Bigdata-developers mailing list
Big...@li...
https://lists.sourceforge.net/lists/listinfo/bigdata-developers
|