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

Cannot invoke "be.ugent.rml.functions.SingleRecordFunctionExecutor.execute(be.ugent.rml.records.Record)" because "this.functionExecutor" is null #224

Open
vchaudhri opened this issue Nov 2, 2023 · 2 comments
Labels
more-information-needed question Further information is requested

Comments

@vchaudhri
Copy link

I will like to generate blank nodes as part of a subject map. I provided the following rule:

rr:subjectMap [
rr:column "Column_Name";
rr:termType "blankNode";
rr:class giam:Entitlement
]

I get the following error:

Cannot invoke "be.ugent.rml.functions.SingleRecordFunctionExecutor.execute(be.ugent.rml.records.Record)" because "this.functionExecutor" is null

How do I fix it? I am using rmlmapper-6.2.1-r368-all.jar

@DylanVanAssche
Copy link
Contributor

It seems that your SubjectMap is not correct. You must use rr:BlankNode as rr:termType's object:

rr:subjectMap [
rr:column "Column_Name";
rr:termType rr:BlankNode;
rr:class giam:Entitlement
]

@DylanVanAssche DylanVanAssche added question Further information is requested more-information-needed labels Nov 3, 2023
@jaxley
Copy link

jaxley commented Nov 18, 2023

Okay, I'm getting the same null pointer exception error.

I did some experimenting and it's being caused by attempting to add an rdf:comment that's an empty string

Use sample data file stuff.json:

{
   "stuff": [
        {"id":"12345", "value":"hi"}
   ]
}

This will cause an exception:

17:09:30.580 [main] DEBUG b.u.rml.records.JSONRecordFactory   .getRecords(40) - No document found for stuff.json. Creating new one
17:09:30.597 [main] DEBUG c.j.j.internal.path.CompiledPath    .evaluate(93) - Evaluating path: $['stuff'][*]
17:09:30.600 [main] DEBUG c.j.j.internal.path.CompiledPath    .evaluate(93) - Evaluating path: $['stuff'][0]['id']
17:09:30.601 [main] ERROR be.ugent.rml.cli.Main               .run(420) - Cannot invoke "be.ugent.rml.functions.SingleRecordFunctionExecutor.execute(be.ugent.rml.records.Record)" because "this.functionExecutor" is null
17:09:30.601 [main] ERROR be.ugent.rml.cli.Main               .run(457) - Cannot invoke "be.ugent.rml.functions.SingleRecordFunctionExecutor.execute(be.ugent.rml.records.Record)" because "this.functionExecutor" is null
java.lang.NullPointerException: Cannot invoke "be.ugent.rml.functions.SingleRecordFunctionExecutor.execute(be.ugent.rml.records.Record)" because "this.functionExecutor" is null
	at be.ugent.rml.termgenerator.LiteralGenerator.generate(LiteralGenerator.java:47)
	at be.ugent.rml.Executor.generatePredicateObjectGraphs(Executor.java:345)
	at be.ugent.rml.Executor.executeWithFunction(Executor.java:178)
	at be.ugent.rml.Executor.execute(Executor.java:132)
	at be.ugent.rml.cli.Main.run(Main.java:416)
	at be.ugent.rml.cli.Main.main(Main.java:49)
---
base: http://www.semanticweb.org/Broken#

prefixes:
  instance: http://www.semanticweb.org/Broken#
  rdfs: http://www.w3.org/2000/01/rdf-schema#
  idlab-fn: http://example.com/idlab/function/
  grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#

sources:
  stuff:
    access: stuff.json
    referenceFormulation: jsonpath
    iterator: "$.stuff[*]"

mappings:
  threats:
    sources: stuff
    subjects: instance:$(id)
    predicateobjects:
      - [rdf:comment, ""]

But, this will process just fine. Only difference is a single character.

---
base: http://www.semanticweb.org/Broken#

prefixes:
  instance: http://www.semanticweb.org/Broken#
  rdfs: http://www.w3.org/2000/01/rdf-schema#
  idlab-fn: http://example.com/idlab/function/
  grel: http://users.ugent.be/~bjdmeest/function/grel.ttl#

sources:
  stuff:
    access: stuff.json
    referenceFormulation: jsonpath
    iterator: "$.stuff[*]"

mappings:
  threats:
    sources: stuff
    subjects: instance:$(id)
    predicateobjects:
      - [rdf:comment, " "]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants