On 06/03/12 15:12, Gunnar Aastrand Grimnes wrote:
Hi Jena users (and hopefully some TopQuadrant people),

I've been trying to use the open-source parts of SPIN-API in my own
application, i.e. outside of topbraid composer.

The plan is to use the qudspin library for on-the-fly conversion of qudt
units.

Now documentation is a bit sparse, but so far I've done:

Load a model with all of:
* SPIN Documents from http://spinrdf.org/spin,spl,sp
* QUDT defn, i.e. all of qudt-units, qudt-dtype, etc.
* The qudspin library - the version from
http://topbraid.org/spin/qudspin uses the old namespace for qudt, I've
changed this.

add a triple:

Model m = getNamedModel("urn:mygraph");

Resource r = m.createResource("urn:resource");
Property p = m.createProperty("urn:p");
m.add(r, p, m.createTypedLiteral(2, "http://qudt.org/vocab/unit#Meter";));

m=getUnionModel();
???

SPINModuleRegistry.get().registerAll(m,null);

Then I pose the query:


PREFIX qudspin: <http://topbraid.org/spin/qudspin#>
PREFIX unit: <http://qudt.org/vocab/unit#>
SELECT * WHERE {
<urn:resource> <urn:p> ?v .
BIND ( qudspin:convertLiteral(?v, unit:Furlong ) as ?length )
}


But this doesn't work :( - ?length never gets any value.

Do you get a row with an unbound ?length or no rows?

It looks like qudspin:convertLiteral(?v, unit:Furlong ) is throwing an exception.

        Andy

There is a chance there is still some namespace issues - I just wanted
to check if there is something SPIN related I've misunderstood?

Anyone here had SPIN working outside TB Composer?

Cheers!

- Gunnar


Reply via email to