Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[lyo-dev] FW: [Bug 533213] New: rdf:Seq deserialization in JMH contains no elements

Hi everyone,

There is a bug regarding poor handling of the RDF collections in Lyo. Do you work with them?

Jim, I remember that we discussed it long time ago and almost came to a conclusion of wontfix on the complex RDF collection mechanisms. I see that Jena has special support for lists:

https://jena.apache.org/tutorials/rdf_api.html#ch-Containers
https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/ModelCon.html#getAlt-org.apache.jena.rdf.model.Resource-
https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/ModelCon.html#getBag-org.apache.jena.rdf.model.Resource-

Ricardo, one of the main reasons we prefer to stay away from RDF collections is that:

- bags are useless, just repeat the predicate as many times as you need
- alt is covered by enumerations in OSLC and SHACL shapes
- seq is virtually unqueryable in SPARQL, we just use the same approach as for bags PLUS each resource instance has property "<i> order 0 ." and so on (can query and ORDER BY in SPARQL).

/Andrew

On 2018-04-04 , 14:48, bugzilla-daemon@xxxxxxxxxxx <bugzilla-daemon@xxxxxxxxxxx> wrote:

    https://bugs.eclipse.org/bugs/show_bug.cgi?id=533213
    Product/Component: Lyo / Core
    
    
                Bug ID: 533213
               Summary: rdf:Seq deserialization in JMH contains no elements
        Classification: Technology
               Product: Lyo
               Version: unspecified
              Hardware: PC
                    OS: Linux
                Status: NEW
              Severity: major
              Priority: P3
             Component: Core
              Assignee: lyo.core-inbox@xxxxxxxxxxx
              Reporter: neormx@xxxxxxxxx
      Target Milestone: 2.x.x
    
    JMH deserialization code for rdf:Seq properties assumes that elements in such
    container are stored as RDFS.member:
    
    https://github.com/eclipse/lyo.core/blob/master/org.eclipse.lyo.oslc4j.provider.jena/src/main/java/org/eclipse/lyo/oslc4j/provider/jena/JenaModelHelper.java#L670
    
    However this is not the case for rdf:Seq elements which are stored as:
    
    http://www.w3.org/1999/02/22-rdf-syntax-ns#_1
    http://www.w3.org/1999/02/22-rdf-syntax-ns#_2
    http://www.w3.org/1999/02/22-rdf-syntax-ns#_3
    ...
    
    As elements in a sequence are not members (from the perspective of the
    predicate) the container is always deserialized empty.
    
    
    
    Since each rdf container implementation (bag, alt, seq) has it own politic
    about the order of the elements, getting them by just listing a certain type of
    statements does not warranties the order of the underlying container will be
    respected. A safer way to obtain the elements in the proper container is to
    cast the Resource instance to the particular Container implementation:
    
    
    Container container = object.as(containerImpl);
    NodeIterator iterator = container.iterator();
    
    -- 
    You are receiving this mail because:
    You are watching the assignee of the bug.


Back to the top