[ 
https://issues.apache.org/jira/browse/JENA-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17567974#comment-17567974
 ] 

Andy Seaborne commented on JENA-2340:
-------------------------------------

I agree there are more use cases than currently are easy to write."per 
solution" is made complicated by the interaction with optimization.

There needs to be some uniqueness guarantee such as "per query" though. 

[PR 1447|https://github.com/apache/jena/issues/] does some preparatory work for 
one or more additional implementations if anyone wants to contribute. Policies 
can be passed in the query context, as can seed values for uniqueness.

For example, the parsers usual bnode allocation scheme is large random seed and 
bit-combine the label. This scales, while ensuring the same bnode for the same 
label in a very large data stream. The original way was to keep a table but 
some usages showed that isn't viable.




> bnode() with literal argument
> -----------------------------
>
>                 Key: JENA-2340
>                 URL: https://issues.apache.org/jira/browse/JENA-2340
>             Project: Apache Jena
>          Issue Type: Comment
>    Affects Versions: Jena 4.5.0
>            Reporter: Justin
>            Assignee: Andy Seaborne
>            Priority: Major
>         Attachments: a2.rq, a2.ttl
>
>
> [^a2.rq]
>  
> About the bnode() function:
> "If the form with a simple literal is used, every call results in distinct 
> blank nodes for different simple literals, and the same blank node for calls 
> with the same simple literal within expressions for one [solution 
> mapping|https://www.w3.org/TR/sparql11-query/#defn_sparqlSolutionMapping].";
> [https://www.w3.org/TR/sparql11-query/]
>  
> In the following example I expected the same bnode to appear multiple times 
> in the o_node column. But instead Jena doesn't reuse any of the bnodes.
> {code:java}
> root@354840b30d6f:/mnt# cat ./a2.ttl 
> @prefix : <http://example/> 
> :s0 :p "one" .
> :s1 :q "one" .
> :s1 :p "one" .
> :s2 :p "two" .
> :s3 :p "two" .
> root@354840b30d6f:/mnt# cat ./a2.rq  
> prefix : <http://example/>
> select * 
> where{
> ?s ?p ?o
> bind(bnode(?o) as ?o_node)
> }
> root@354840b30d6f:/mnt# ./apache-jena-4.5.0/bin/sparql --data=./a2.ttl 
> --query=./a2.rq
> -----------------------------
> | s   | p  | o     | o_node |
> =============================
> | :s0 | :p | "one" | _:b0   |
> | :s3 | :p | "two" | _:b1   |
> | :s2 | :p | "two" | _:b2   |
> | :s1 | :p | "one" | _:b3   |
> | :s1 | :q | "one" | _:b4   |
> ----------------------------- {code}
> How do you get the bnode() function with a literal argument to return the 
> same bnode?
> I feel like perhaps I am not understanding what it means to have "one 
> solution mapping."



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to