You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Claude Warren <cl...@xenei.com> on 2017/04/18 15:53:16 UTC

construct with jena jdbc driver

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

Re: construct with jena jdbc driver

Posted by Claude Warren <cl...@xenei.com>.
Thanks for the help.  I ended up converting to RDFConnection for connection
handling.

Claude

On Tue, Apr 18, 2017 at 5:03 PM, Rob Vesse <rv...@dotnetrdf.org> wrote:

> 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" <cl...@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
>
>
>
>
>
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: construct with jena jdbc driver

Posted by Rob Vesse <rv...@dotnetrdf.org>.
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" <cl...@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