Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SERVICE fails in empty context. #1399

Closed
afs opened this issue Jun 23, 2022 · 4 comments · Fixed by #1388
Closed

SERVICE fails in empty context. #1399

afs opened this issue Jun 23, 2022 · 4 comments · Fixed by #1388
Labels

Comments

@afs
Copy link
Member

afs commented Jun 23, 2022

Version

4.6.0-SNAPSHOT

What happened?

Executing a query involving SERVICE with an empty context does not work because there is no default service execution.

@Aklakan - for your improvements in this area, could you please ensure that it executes when the context does not have a setting for ARQConstants.registryServiceExecutors.

Relevant output and stacktrace

public static void main(String...args) {
        FusekiLogging.setLogging();
        FusekiServer server = FusekiServer.create()
                .port(0)
                .add("/ds",  DatasetGraphFactory.empty())
                .start();
        String SERVICE = "http://localhost:"+server.getPort()+"/ds";
        Node expected = NodeFactory.createLiteral("28181", XSDDatatype.XSDinteger);
        String queryString = "SELECT * { SERVICE <"+SERVICE+"> { VALUES ?x { 28181 } } }";
        // Empty context
        Context cxt = new Context();
        //Context cxt = ARQ.getContext().copy();
        RowSet rs = QueryExec.dataset(DatasetGraphFactory.empty())
                .query(queryString)
                .context(cxt)
                .select()
                .materialize();
        assertTrue(rs.hasNext());
        Node n = rs.next().get("x");
        assertEquals(expected, n);
    }

Are you interested in making a pull request?

No response

@afs afs added the bug label Jun 23, 2022
@Aklakan
Copy link
Contributor

Aklakan commented Jun 23, 2022

So the rules should be like follows - right?

  • empty context → default behavior i.e. http service request should work
  • context with present but empty service executor registry → error because no registered executor

@afs
Copy link
Member Author

afs commented Jun 23, 2022

Yes.

"Empty context" here means no entry for ARQConstants.registryServiceExecutors. The rest of the context is not important.

This is motivated by the work elsewhere dealing with the context for query execution (other registries).

  1. There is already a separate flag to turn SERVICE off completely.
  2. "No entry" should give some default SPARQL execution as expected behaviour.

What happens if there is an empty service executor registry is less important. Your suggestion makes sense to me because it is a configuration error by the application.

Aklakan added a commit to Aklakan/jena that referenced this issue Jun 23, 2022
@Aklakan
Copy link
Contributor

Aklakan commented Jun 23, 2022

I added a fix within #1388 - will test tomorrow.

@afs
Copy link
Member Author

afs commented Jun 24, 2022

If you add "This fixes #1399" to the description, magic happens and this issue is automatically closed.

@afs afs closed this as completed in #1388 Jul 3, 2022
Aklakan added a commit to Aklakan/jena that referenced this issue Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants