[ 
https://issues.apache.org/jira/browse/JENA-2340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin updated JENA-2340:
-------------------------
    Description: 
[^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."

  was:
[^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?


> bnode() with literal argument
> -----------------------------
>
>                 Key: JENA-2340
>                 URL: https://issues.apache.org/jira/browse/JENA-2340
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: Jena 4.5.0
>            Reporter: Justin
>            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