Am 4. Mai 2026 23:54:15 MESZ schrieb Andy Seaborne <[email protected]>:
>
>
>On 04/05/2026 09:57, Lars G. Svensson wrote:
>>
>> class PointyBracketsTest {
>> 
>>      @Test
>>      void test() {
>>          final Resource r = ResourceFactory.createResource("");
>
>The API does not resolve URIs - it allows relative URIs. Legacy.
>
>It is not a good idea to use relative URIs in the API.

OK.
>
>>          final Model m = ModelFactory.createDefaultModel();
>>          m.add(r, DCTerms.title, "A Title");
>>          // check that the statement is present...
>>          final StmtIterator iter = m.listStatements();
>>          while (iter.hasNext()) {
>>              System.out.println(iter.nextStatement());
>>          }
>>          final String query = "SELECT * WHERE {<> ?p ?o}";
>
>That query string is resolved. Parsing (RDF syntax, SPARQL syntax) always 
>resolves URIs.
>
>>          final Query q = QueryFactory.create(query);
>
>Parses with default base.
>
>Try:
>            // Set the base to something else.
>            q.setBaseURI("http://myBase/";);
>            System.out.println(q);
>
>and you should see the real URI in the query.

Ah, I think I understand. Thank you for the  explanation.

Best, 
Lars

Reply via email to