Skip to content

How to retrieve RDFList ? #77

Description

@AlexTo

Hi
I am using Jena function model.createList(...) to create a RDFList.

Then I will have the following triples in MarkLogic.

<:subj1>                  <has-list>      <_:bnode-some-uuid-1>
<_:bnode-some-uuid-1>    <rdf:first>      <:Alex>
<_:bnode-some-uuid-1>    <rdf:rest>      <_:bnode-some-uuid-2>
<_:bnode-some-uuid-2>    <rdf:first>      <:Bob>
<_:bnode-some-uuid-2>    <rdf:rest>      <_:bnode-some-uuid-3> 
....

Now if I want to retrieve the list like I normally do in Jena TDB2, I would query as follows

val stmts = model.listStatements(subj, hasList, null)
val stmt = stmts.next()
val list = stmt.getObject.as(classOf[RDFList])

However, since list is a blank node, this does not work in MarkLogic with the following exception

org.apache.jena.shared.JenaException: Cannot convert node 99c61fc0120934c355bd035658b0cbad to RDFList

The UUID in the exception is different everytime so probably MarkLogic Jena generates it upon each query for a blank node.

So my question is how to deal with RDFList in MarkLogic Jena? I am thinking of probably converting all the blank nodes before saving to MarkLogic but I am not sure how to do it nicely with model.createList(...) because model.createList(...) will just create all the blank nodes and write to MarkLogic graph.

Thank you

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions