cast error with virtual graphs

4 views
Skip to first unread message

Steffen Stadtmüller

unread,
Dec 5, 2016, 11:12:02 AM12/5/16
to Stardog
Hi,

I am trying to connect a oracle DB as virtual graph to stardog.
There is only a simple table with two columns (ID and PART), both containing directly http IRIs as VARCHAR.

So I am using the following R2RML mapping:

@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix ex: <http://example.org/example#>.

<#TriplesMap1>
        rr
:logicalTable [ rr:tableName "TABLE" ] ;
        rr
:subjectMap [
                rr
:termType rr:IRI;
                rr
:column "ID"
       
];
        rr
:predicateObjectMap [
                rr
:predicate ex:isPartOf ;
                rr
:objectMap [
                        rr
:termType rr:IRI; ;
                        rr
:column "PART" ];
       
].



However, when trying to register the graph I get the following error:

$ bin/stardog-admin virtual add oracle.properties oracle.ttl --format R2RML
it.unibz.inf.ontop.model.impl.VariableImpl cannot be cast to it.unibz.inf.ontop.model.ValueConstant

Am I doing something wrong with the R2RML?
(if I use rr:template without rr:termType everything works fine, except of course the IRI are encoded. So I do not assume that there is an issue with the JDBC drivers.)

Any help to what is going on would be much appreciated :-)

Zachary Whitley

unread,
Dec 5, 2016, 11:28:50 AM12/5/16
to Stardog
I'm guessing a little bit here but it's probably a probably a problem with generating terms that aren't valid URI's. It would help if you could send a few rows from your table. You can also add a -v flag to your "stardog-admin virtual add/import" command to get additional information.

"Term maps with term type rr:IRI cause data errors if the value is not a valid IRI (see generated RDF term for details). Data values from the input database may require percent-encoding before they can be used in IRIs. Template-valued term maps are a convenient way of percent-encoding data values." [1]

Try taking a look at the term generating rules [2]

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+unsubscribe@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.

Jess Balint

unread,
Dec 5, 2016, 11:53:54 AM12/5/16
to sta...@clarkparsia.com
Hi Steffen,

The current virtual graph implementation assumes a prefixed IRI template for subjects. I have filed a bug as issue #3315.

Jess

Steffen Stadtmüller

unread,
Dec 6, 2016, 4:25:15 AM12/6/16
to Stardog
Hi,

thanks for your support.

I get the same error, when using a template in the subjectMap, but rr:column (with IRI termType) in the objectMap.
Does the same issue also exist for objects?

So, am I correct that the only workaround for now is to store just local identifiers in the DB and handling the namespaces in the R2RML via a template?

Steffen

Jess Balint

unread,
Dec 6, 2016, 4:56:14 PM12/6/16
to sta...@clarkparsia.com
Steffen,

The error isn't quite the same from what I can tell. The object map you posted was as follows:

                rr:objectMap [
                        rr
:termType rr:IRI; ;
                        rr
:column "PART" ];

This will load and execute fine, but the column is assumed to be the local name of the IRI. The prefix specified as the base will be used. Currently it's not possible to use a column's value as a complete IRI and your conclusion is correct. It will work to store local names in the database and the prefix in the R2RML mapping.

Best,
Jess

Jess Balint

unread,
Dec 6, 2016, 5:05:47 PM12/6/16
to sta...@clarkparsia.com
Steffen,

Pardon my mistake. The error is the same. Either way the workaround is as you suggested.

Jess

Steffen Stadtmüller

unread,
Dec 9, 2016, 5:29:40 AM12/9/16
to Stardog
Alright. Thanks so far :-)

Then I will hope/wait for a fix...
Reply all
Reply to author
Forward
0 new messages