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

RDFUpdater graph parameter is not optional although it's described as such #1

Open
glaserL opened this issue Jul 6, 2023 · 1 comment

Comments

@glaserL
Copy link

glaserL commented Jul 6, 2023

The documentation for the RDFUpdater states that the graph parameter is optional:

https://github.com/acoli-repo/fintan-doc/blob/46e795e1fc078d5904519711de06e93cc9afb464/3a-core-components.md?plain=1#L118C148-L118C148

However when omitted, a NullPointerException occurs:

Exception in thread "main" java.lang.NullPointerException
        at org.acoli.fintan.rdf.RDFUpdaterFactory.buildFromJsonConf(RDFUpdaterFactory.java:114)
        at org.acoli.fintan.rdf.RDFUpdaterFactory.buildFromJsonConf(RDFUpdaterFactory.java:34)
        at org.acoli.fintan.core.FintanManager.buildComponent(FintanManager.java:423)
        at org.acoli.fintan.core.FintanManager.buildDefaultPipeline(FintanManager.java:243)
        at org.acoli.fintan.core.FintanManager.buildComponentStack(FintanManager.java:157)
        at org.acoli.fintan.core.FintanManager.main(FintanManager.java:110)
        at org.acoli.fintan.FintanCLIManager.main(FintanCLIManager.java:27)

Used Configuration

{
      "class": "RDFUpdater",
      "models": [
        {
          "source": "file:///some_graph.nt",
        }
      ],
      "updates": [{ "path": "script.sparql", "iter": "1" }]
    }
@cfaeth
Copy link
Collaborator

cfaeth commented Jul 6, 2023

Hi,
this is indeed a small bug, probably due to a minimal change in the jackson API. Currently the UpdaterFactory checks whether the textual representation of "graph" in the config file equals an empty string. However this seems to return null instead of an empty string when "graph" is not included in the file.

As a workaround, you could adjust your config file as follows:

{
      "class": "RDFUpdater",
      "models": [
        {
          "source": "file:///some_graph.nt",
          "graph": ""
        }
      ],
      "updates": [{ "path": "script.sparql", "iter": "1" }]
    }

It should work like that. I will make sure to include a fix in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants