Hi Guillaume,
thanks for the explanation!
On 05/25/2011 01:56 PM, Guillaume Hillairet wrote:
> Hi Moritz,
>
> This generally happens when it try to load an rdf resource that has no
> rdf:type attached. This can be because nothing is written in the rdf
> store (bad file location?), or
> when it try to load an object with a wrong uri.
> I have to test the example again, and see what is going on.
> Nevertheless, this has to be fixed, because it should not raise this
> exception, but rather return null.
I figured out what the problem was: The objects in the graph are not
accessible via the URI fragment (graph#object), but they need to be
encoded like graph/object. The solution was to change the following
string in the sample application:
URI.createURI("emftriple://neo_test?graph=http://test&uri=http://eclipselabs.org/emftriple/model#parent_0"),
To:
URI.createURI("emftriple://neo_test?graph=http://test&uri=http://eclipselabs.org/emftriple/model/parent_0"),
> Also, lower the number of parents actually created to 100 or less.
> There is still some performance issues with very large number of
> objects.
I noticed that the example with 1000^2 objects causes the JVM to crash,
so I already reduced the number of objects... Is the problem that all
objects are stored in one graph and thus are loaded into memory at once?
Kind regards,
Moritz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iF4EAREIAAYFAk3eAZEACgkQ264ap80Va8fv6gEAjHzhlsDo1DUo0N5fkAiIJfNQ
cn6b6cMBabqztQDF+0gA/2DHoqbC4MK/cSUMpfoUK5TeuRsm2wO7bmgysAZ6JJ+R
=rGOp
-----END PGP SIGNATURE-----
Hello Guillame,
first of all, thanks for this piece of software, it's very helpful! I am
now able to run the example, and I start to understand how you
structured the projects.
The next step for me is now to support Jena+files, and I saw that you
have started an implementation, which is not finished. I added a
FileResourceImpl and FileResourceFactory. They are rather minimal at the
moment, it's possible to load data from turtle files.
The next problem I ran into is the handling of references. The file I
want to read uses anonymous references all over the place, but emftriple
seems to expect references to URIs. For Jena, this can be solved by
changing the URL for proxies to
"_:"+resource.getAnonId.toString(),
that way the SPARQL queries work. Emftriple creates the objects, but
only as proxies, which are somehow never initialized. I have to do some
more research on this ;-)
Actually, I think it's not the best way of handling blank nodes. These
objects could be transformed to EMF object directly. I tried to do that
by calling loadEObject again with the nested object's URI, which works
very well.
The other issue I have are URI references in the triples. Let's say I have:
subject ns:references <http://some.url.com/object>
How do I get the URI into my EMF model? I don't know what's behind the
URI, so I would like to have it as a URI, not a modeled object. Is it
possible to solve this?
Thanks again!
Moritz
On 05/26/2011 12:00 PM, Guillaume Hillairet wrote:
> Hi Moritz,
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iF4EAREIAAYFAk3eQrEACgkQ264ap80Va8f+MQEAtG+0DOlJHC9uXj5/5s4c/GZQ
zUNkx/LAtvBK9TtpRjYA/3z9DeXwusTTdzKiJjbvy9SdxQNXAc6tYPeCUwGh0CEB
=9gAz
-----END PGP SIGNATURE-----
Hi,
comments below.
On 05/30/2011 12:08 PM, Guillaume Hillairet wrote:
>> The next step for me is now to support Jena+files, and I saw that you
>> have started an implementation, which is not finished. I added a
>> FileResourceImpl and FileResourceFactory. They are rather minimal at the
>> moment, it's possible to load data from turtle files.
>
> Actually, support for RDF files was in previous versions. I can bring
> it back quite easily.
That would be great!
>> The next problem I ran into is the handling of references. The file I
>> want to read uses anonymous references all over the place, but emftriple
>> seems to expect references to URIs. For Jena, this can be solved by
>> changing the URL for proxies to
>>
>> "_:"+resource.getAnonId.toString(),
>>
>> that way the SPARQL queries work. Emftriple creates the objects, but
>> only as proxies, which are somehow never initialized. I have to do some
>> more research on this ;-)
>
> Yes, every object in a reference is first created as a proxy. The
> proxy URI is the resource URI plus the RDF node URI as fragment. If
> the
> URI node is a blank node, then the created proxy URI will not be a
> valid one. So the proxy could not be loaded. The loading of an EMF
> proxy is
> done by a SPARQL query that tries to find the RDF resource
> corresponding to the proxy URI. The query won't work on blank nodes.
I managed to get it working. I now use an URI of "_:"+anonid, and this
one can be used in SPARQL queries to fetch proxy objects.
>
>> Actually, I think it's not the best way of handling blank nodes. These
>> objects could be transformed to EMF object directly. I tried to do that
>> by calling loadEObject again with the nested object's URI, which works
>> very well.
Now as the anonymous URIs work, this is obsolete... And looking at the
source of the Jena implementation, this would not make sense.
>> How do I get the URI into my EMF model? I don't know what's behind the
>> URI, so I would like to have it as a URI, not a modeled object. Is it
>> possible to solve this?
>
> That's not possible right now, because this RDF property has for range
> a URI, and thus could be only map to an EReference.
> To change that we could add some annotations on the EMF model, in
> order to say that this property have to be map to an EAttribute
> instead. So the
> URIs could be stored in a list of string for example.
I solved this issue in a similar way: If there is an EAttribute for some
predicate, and the object is a URI, then it will be stored as String in
the attribute.
Attached you'll find a patch that implements this and the URI handling.
Feel free to include it in the master branch!
Kind regards,
Moritz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iF4EAREIAAYFAk3ji/QACgkQ264ap80Va8eD9wD9FK1tkIO4Ifb2f7iBtBqLT8uW
5WOLDhmGe1w6R+RnwdMBAICelFKBIreMyeHDMwZ0NhrEeOV1v2KDqiH+EDDZt99j
=1ll7
-----END PGP SIGNATURE-----