Discussion:
construct with jena jdbc driver
Claude Warren
2017-04-18 15:53:16 UTC
Permalink
Quick question:

I have a construct query that returns various types for the object.

example:

CONSTRUCT
{
<urn:a:url> ?p ?o .
}
WHERE
{ <urn:a:url> ?p ?o
}

Is there a method in the JDBC driver that will allow me to determine what
that type is? Parsing string -vs- URI is rather difficult. :(

Thx,
Claude
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
Rob Vesse
2017-04-18 16:03:30 UTC
Permalink
You can set the compatibility level on the connection which will try to sniff the results and set an appropriate column type, however if the results are very mixed the sniffing can/will be inaccurate.

http://jena.apache.org/documentation/jdbc/drivers.html#jdbc-compatibility-level

You can also access the utility methods that do this sniffing on a specific column value to detect the equivalent JDBC type:

http://jena.apache.org/documentation/javadoc/jdbc/org/apache/jena/jdbc/JdbcCompatibility.html#detectColumnType-java.lang.String-org.apache.jena.graph.Node-boolean-

Hope this helps,

Rob

On 18/04/2017 16:53, "Claude Warren" <***@xenei.com> wrote:

Quick question:

I have a construct query that returns various types for the object.

example:

CONSTRUCT
{
<urn:a:url> ?p ?o .
}
WHERE
{ <urn:a:url> ?p ?o
}

Is there a method in the JDBC driver that will allow me to determine what
that type is? Parsing string -vs- URI is rather difficult. :(

Thx,
Claude

--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
Claude Warren
2017-04-19 11:05:33 UTC
Permalink
Thanks for the help. I ended up converting to RDFConnection for connection
handling.

Claude
Post by Rob Vesse
You can set the compatibility level on the connection which will try to
sniff the results and set an appropriate column type, however if the
results are very mixed the sniffing can/will be inaccurate.
http://jena.apache.org/documentation/jdbc/drivers.
html#jdbc-compatibility-level
You can also access the utility methods that do this sniffing on a
http://jena.apache.org/documentation/javadoc/jdbc/org/apache/jena/jdbc/
JdbcCompatibility.html#detectColumnType-java.lang.
String-org.apache.jena.graph.Node-boolean-
Hope this helps,
Rob
I have a construct query that returns various types for the object.
CONSTRUCT
{
<urn:a:url> ?p ?o .
}
WHERE
{ <urn:a:url> ?p ?o
}
Is there a method in the JDBC driver that will allow me to determine what
that type is? Parsing string -vs- URI is rather difficult. :(
Thx,
Claude
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
--
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren
Loading...