Just perfect as usual !
Let's go to play with !
Big Danke !
++
On 08/14/2012 11:02 AM, Rupert Westenthaler wrote:
Hi Florent, all
I checked this and it looks like a Bug in the
SingleTdbDatasetProvider. The #getTriples(UriRef) method checks the
parsed UriRef for the default graph name in the if() for the MGrpahs.
Because of that a NoSuchEntityException is issues by the called
#getMGraph(UriRef) method. I created an Issue for that [1]. This
causes the ClerezzaYard thinking that a graph with the default graph
URI does not exist. What finally causes the reported
EntityAlreadyExistsException.
I already committed a fix [2], but I had not enough time to check if
this also fixes your problem with the described setting. Florent can
you please check that check that.
Thanks for reporting.
best
Rupert
[1] https://issues.apache.org/jira/browse/CLEREZZA-714
[2] http://svn.apache.org/viewvc?rev=1372786&view=rev
On Mon, Aug 13, 2012 at 10:24 PM, florent andré
<[email protected]> wrote:
Hi Rupert, Stanbolers !
I just give a try to this pretty implementation, and face an error message.
Not directly related to SingleDatasetTdbTcProvider but maybe because I loose
myself in configuration.
So, my idea is to query this singleDataset via entityHub (doable right ?).
And then after correctly configure this provider (in fact I hope it correct
- see [0]), I go to configure a clerezzaYard [1] and then a YardSite to get
it available throw entity hub (see config in [2]).
Unfortunately, the yardSite don't achieve it's startup as an
"
org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException: An entity
with this name already exists: <{$UNION-GRAPHNAME}>
"
error fired (stack trace on [3]).
Seems to be just that yardSite try to create the graph when startup... graph
that is already set-up during singleDataSet initialization.
Bug, or Florent lost in the wood ? :)
(
PS :
* svn info stanbol :
URL: https://svn.apache.org/repos/asf/incubator/stanbol/trunk/
Revision: 1372163
* via mvn :
org.apache.clerezza.rdf.jena.tdb.storage
0.6.0.incubating-SNAPSHOT
)
======= [0] =======
***
config file name =
org.apache.clerezza.rdf.jena.tdb.storage.SingleTdbDatasetTcProvider-lh.config
***
tdb-dir="/opt/linkedheritage/lhdev/"
default-graph-name="lhgraph"
weight="1010"
======= [1] =======
***
config file name =
org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard-lh.config
***
org.apache.stanbol.entityhub.yard.id="lhclerezzayard"
org.apache.stanbol.entityhub.yard.name="Linked Heritage Yard"
org.apache.stanbol.entityhub.yard.description="Contains all the Linked
Heritage thesaurus"
org.apache.stanbol.entityhub.yard.clerezza.graphuri="lhgraph"
======= [2] =======
***
config file name =
org.apache.stanbol.entityhub.site.managed.YardSite-lh.config
***
org.apache.stanbol.entityhub.site.id="LHYardSite"
org.apache.stanbol.entityhub.site.name="THE LH Yard Site"
org.apache.stanbol.entityhub.site.description="Provide access to all managed
thesauri"
org.apache.stanbol.entityhub.site.yardId="lhclerezzayard"
====== [3] =========
13.08.2012 20:46:23.660 *INFO* [Thread-45]
org.apache.stanbol.commons.solr.managed.impl.ManagedSolrServerImpl ...
Index dbpedia on ManagedSolrServer default is now ACTIVE
13.08.2012 20:46:33.585 *INFO* [1065001640@qtp-1507255250-1]
org.apache.stanbol.commons.web.base.processor.FreemarkerViewProcessor
Assigned default freemarker configuration
13.08.2012 20:50:45.633 *INFO* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.stanbol.entityhub.site.managed.YardSite.4fd75e51-b021-4882-a56c-29257ce2479c)]
org.apache.stanbol.entityhub.site.managed.ManagedSiteComponent > initialise
Managed Site LHsite
13.08.2012 20:50:45.635 *INFO* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.stanbol.entityhub.site.managed.YardSite.4fd75e51-b021-4882-a56c-29257ce2479c)]
org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard in class
org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard activate with
context org.apache.felix.scr.impl.manager.ComponentContextImpl@3e6ea3fe
13.08.2012 20:50:45.635 *INFO* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.stanbol.entityhub.site.managed.YardSite.4fd75e51-b021-4882-a56c-29257ce2479c)]
org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard ... create
new Graph <lhgraph> for Yard Linked Heritage Yard
13.08.2012 20:50:45.635 *ERROR* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.stanbol.entityhub.site.managed.YardSite.4fd75e51-b021-4882-a56c-29257ce2479c)]
org.apache.stanbol.entityhub.yard.clerezza
[org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard] The activate
method has thrown an exception
(org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException: An entity
with this name already exists: <lhgraph>)
org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException: An entity
with this name already exists: <lhgraph>
at
org.apache.clerezza.rdf.jena.tdb.storage.SingleTdbDatasetTcProvider.createMGraph(SingleTdbDatasetTcProvider.java:616)
at
org.apache.clerezza.rdf.core.access.TcProviderMultiplexer.createMGraph(TcProviderMultiplexer.java:297)
at
org.apache.clerezza.rdf.core.access.TcManager.createMGraph(TcManager.java:203)
at
org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard.activate(ClerezzaYard.java:198)
at
org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard.activate(ClerezzaYard.java:166)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
at
org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at
org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
at
org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)
at
org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
at
org.apache.felix.scr.impl.manager.DelayedComponentManager.createRealComponent(DelayedComponentManager.java:95)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager$Registered.getService(AbstractComponentManager.java:1148)
at
org.apache.felix.scr.impl.manager.DelayedComponentManager.getService(DelayedComponentManager.java:88)
at
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:310)
at
org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
at
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
at org.apache.felix.framework.Felix.getService(Felix.java:3014)
at
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
at
org.apache.stanbol.entityhub.site.managed.ManagedSiteComponent$1.addingService(ManagedSiteComponent.java:158)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)
at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)
at
org.apache.stanbol.entityhub.site.managed.ManagedSiteComponent.activate(ManagedSiteComponent.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
at
org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at
org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
at
org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)
at
org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:398)
at
org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:228)
at
org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:277)
at
org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1832)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)
at java.lang.Thread.run(Thread.java:662)
13.08.2012 20:50:45.636 *ERROR* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.stanbol.entityhub.site.managed.YardSite.4fd75e51-b021-4882-a56c-29257ce2479c)]
org.apache.stanbol.entityhub.yard.clerezza
[org.apache.stanbol.entityhub.yard.clerezza.impl.ClerezzaYard] Failed
creating the component instance; see log for reason
13.08.2012 20:50:45.637 *WARN* [CM Event Dispatcher (Fire
ConfigurationEvent:
pid=org.apache.stanbol.entityhub.site.managed.YardSite.4fd75e51-b021-4882-a56c-29257ce2479c)]
org.apache.stanbol.entityhub.site.managed.ManagedSiteComponent Unable to
addService for ServiceReference becauseunable to obtain referenced Yard via
the BundleContext!
13.08.2012 20:50:45.637 *ERROR* [FelixDispatchQueue]
org.apache.stanbol.entityhub.yard.clerezza FrameworkEvent ERROR
(org.osgi.framework.ServiceException: Service factory returned null.)
org.osgi.framework.ServiceException: Service factory returned null.
at
org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:343)
at
org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)
at
org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
at org.apache.felix.framework.Felix.getService(Felix.java:3014)
at
org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
at
org.apache.stanbol.entityhub.site.managed.ManagedSiteComponent$1.addingService(ManagedSiteComponent.java:158)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)
at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)
at
org.apache.stanbol.entityhub.site.managed.ManagedSiteComponent.activate(ManagedSiteComponent.java:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
at
org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at
org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
at
org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)
at
org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997)
at
org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333)
at
org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:398)
at
org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:228)
at
org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:277)
at
org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1832)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)
at java.lang.Thread.run(Thread.java:662)
On 06/19/2012 01:41 PM, Rupert Westenthaler wrote:
Hi all
Today I found some time to implement the remaining changes to the
SingleDatasetTdbTcProvider. Here is a short Overview
* It supports multiple Instances (configurationFactory=true): This
allows users to manually configure multiple TDB datasets
* This means that it is still possible to have totally independent
RDF datasets
* Users that create additional instances for special usages should
assign low service rankings so that the Clerezza TcManager uses the
default instance to create new graphs
* It uses configuration policy OPTIONAL: This means that by default an
instance with the default parameter is created
* you can still configure the default instance by providing a
configuration with the name
"org.apache.clerezza.rdf.jena.tdb.storage.SingleDatasetTdbTcProvider"
to the "Configuration Admin Service"
* It supports read-only access to the UNION graph - to enable this
feature users need to configure the URI of the union graph
### Configurations (and defaults)
* service ranking = 106 : This is higher as the old TdbTcProvider - so
the SingleDatasetTdbTcProvider will be preferable used.
* storage location : {bundle-data-dir}/singleTdb/{service.pid}
* the service ID of the default instance is the class name of the
component implementation - "SingleDatasetTdbTcProvider"
* can be configured by the "tdb-dir" property of the configuration.
* if you change the value of the "tdb-dir" property data of the
current storage location will NOT be copied
* if the value of the "tdb-dir" property points to an existing Jena
TDB dataset the SingleDatasetTdbTcProvider will be initialized using
the existing data.
* default-graph-name: The URI used to expose the UNION graph via the
TcProvider.
* This allows users to lookup the UNION graph via the TcManager
interface.
* If this configuration is missing or empty the UNION graph feature
is deactivated.
### Dealing with multiple instances
Via the TcManager interface the TcProvider with the highest ranking
will be used to create new graphs. So this interface can not directly
used to work with multiple instances.
However OSIG filter can be easily used to query/inject a specific
TcProvider. In case of the SingleDatasetTdbTcProvider the
"default-graph-name" is best suited for that. Creating/using such an
filter is quite easy:
ServcieReference[] refs = bundleContext.getServiceReferences(
SingleDatasetTdbTcProvider.class.getName(),
"(default-graph-name="+graphName.getUnicodeString())+')');
### Version Management
The changes are applied to the trunk. The current version of the bundle is
<groupId>org.apache.clerezza</groupId>
<artifactId>rdf.jena.tdb.storage</artifactId>
<version>0.6-incubating-SNAPSHOT</version>
It runs fine with the currently released versions of the dependencies.
So for Apache Stanbol users it should be enough to replace the
"0.5-incubating" version with the "0.6-incubating-SNAPSHOT".
Happy testing,
best
Rupert
On Thu, Apr 5, 2012 at 4:03 PM, Reto Bachmann-Gmür <[email protected]>
wrote:
On Thu, Apr 5, 2012 at 1:16 PM, Rupert Westenthaler <
[email protected]> wrote:
Von meinem iPad gesendet
Am 05.04.2012 um 12:59 schrieb Reto Bachmann-Gmür <[email protected]>:
Hi Rupert,
I like your proposal but would suggest:
- SingleDatasetTdbTcProvider should not need a directory configured
No problem with that. One can use the configuration policy OPTIONAL,
than
OSGI will create a default instance with the default directory while it
would still be possible for users to creat additional instances with
manually configured directories.
WDYT
Not sure why one would need to create multiple
SingleDatasetTdbTcProviderS.
With the current limitation of TcManager I don't think there's much use
in
having multiple instances, but of course I wouldn't mind having this
possibility.
Cheers,
Reto