Current Behavior
Write the number 5 of unspecified data type, int type, and long type to the database.
The Java code which writes the numbers to the database is:
Repository db = new SailRepository(new MemoryStore());
IRI john = Values.iri("http://JohnSmith");
IRI mark = Values.iri("http://Mark");
IRI peter = Values.iri("http://Peter");
try (RepositoryConnection conn = db.getConnection()) {
conn.add(john, FOAF.AGE, Values.literal(5));
conn.add(mark, FOAF.AGE, Values.literal(String.valueOf(5), XSD.INT));
conn.add(peter, FOAF.AGE, Values.literal(String.valueOf(5), XSD.LONG));
}
Then query the database for the statement whose literal value is 5.
The SparQL query statement is:
SELECT *
WHERE { ?s ?p 5. }
The query result is empty, instead of the three number 5 in the database.
Expected Behavior
The expected query result is:
| ?s |
?p |
<http://JohnSmith> |
<http://xmlns.com/foaf/0.1/age> |
<http://Mark> |
<http://xmlns.com/foaf/0.1/age> |
<http://Peter> |
<http://xmlns.com/foaf/0.1/age> |
Steps To Reproduce
-
Write the following Java code to write the numbers to the database:
Repository db = new SailRepository(new MemoryStore());
IRI john = Values.iri("http://JohnSmith");
IRI mark = Values.iri("http://Mark");
IRI peter = Values.iri("http://Peter");
try (RepositoryConnection conn = db.getConnection()) {
conn.add(john, FOAF.AGE, Values.literal(5));
conn.add(mark, FOAF.AGE, Values.literal(String.valueOf(5), XSD.INT));
conn.add(peter, FOAF.AGE, Values.literal(String.valueOf(5), XSD.LONG));
}
-
Execute the following query:
SELECT *
WHERE { ?s ?p 5. }
The corresponding Java code is:
try (RepositoryConnection conn = db.getConnection()) {
String queryString = "SELECT * WHERE { ?s ?p 5. }";
TupleQuery query = conn.prepareTupleQuery(queryString);
TupleQueryResultHandler tsvWriter = new SPARQLResultsTSVWriter(System.out);
query.evaluate(tsvWriter);
}
Version
4.0.0-M1
Are you interested in contributing a solution yourself?
No response
Anything else?
No response
Current Behavior
Write the number 5 of unspecified data type, int type, and long type to the database.
The Java code which writes the numbers to the database is:
Then query the database for the statement whose literal value is 5.
The SparQL query statement is:
The query result is empty, instead of the three number 5 in the database.
Expected Behavior
The expected query result is:
<http://JohnSmith><http://xmlns.com/foaf/0.1/age><http://Mark><http://xmlns.com/foaf/0.1/age><http://Peter><http://xmlns.com/foaf/0.1/age>Steps To Reproduce
Write the following Java code to write the numbers to the database:
Execute the following query:
The corresponding Java code is:
Version
4.0.0-M1
Are you interested in contributing a solution yourself?
No response
Anything else?
No response