# predicateMap's issue in R2RML

**URL:** <https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453>\
**Category:** Support\
**Created:** [July 11, 2017, 8:17pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453 "2017-07-11T20:17:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jafarpour](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jafarpour](https://community.stardog.com/u/jafarpour)\
**Post date:** [July 11, 2017, 8:17pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/1 "2017-07-11T20:17:11Z")

</div>

Hi. I have started testing stardog’s r2rml capabilities and they look good. However, I have noticed that **predicateMap** have an issue. I have a predicate mapping as follows:

`rr:predicateMap [rr:template "http://www.ontology.com/ontologies/property/{PROPERTY}"] ; # PROPERTY is a column name that is never null`

I get this error:

```
ColumnOrConst is null.
The detailed stack trace for the error is:
com.complexible.stardog.cli.CliException: ColumnOrConst is null.
        at com.complexible.stardog.cli.impl.ConnectionCommand.call(ConnectionCommand.java:73)
        at com.complexible.stardog.cli.CLIBase.execute(CLIBase.java:55)
        at com.complexible.stardog.cli.admin.CLI.main(CLI.java:182)
Caused by: com.complexible.stardog.StardogException: ColumnOrConst is null.
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.checkResponseCode(BaseHttpClient.java:492)
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.execute(BaseHttpClient.java:324)
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPost(BaseHttpClient.java:662)
        at com.complexible.stardog.protocols.http.client.BaseHttpClient.executeHttpPost(BaseHttpClient.java:637)
        at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminClientImpl.addOrUpdate(HttpVirtualGraphAdminClientImpl.java:233)
        at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminClientImpl.addGraph(HttpVirtualGraphAdminClientImpl.java:202)
        at com.complexible.stardog.protocols.http.client.HttpVirtualGraphAdminClientImpl.addGraph(HttpVirtualGraphAdminClientImpl.java:51)
        at com.complexible.stardog.protocols.http.client.AbstractVirtualGraphAdminConnection.addGraph(AbstractVirtualGraphAdminConnection.java:86)
        at com.complexible.stardog.virtual.cli.VirtualGraphImport.execute(VirtualGraphImport.java:135)
        at com.complexible.stardog.cli.impl.ConnectionCommand.call(ConnectionCommand.java:61)

```

Any help or suggestions? I tried quoting the column name as well. Rest of the mappings work fine. This column (`PROPERTY`) is never null in the DB.

additionally, If I use `property` instead of `PROPERTY`, I get the error that column does not exist.

Thanks

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [July 11, 2017, 11:05pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/2 "2017-07-11T23:05:10Z")

</div>

Borna,

You are using Stardog 5.0 (not 5.0.1), correct? Can you share the exception from the log file when running this command?

Jess

---

<div class="post-metadata">

**Author:** ![jafarpour](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jafarpour](https://community.stardog.com/u/jafarpour)\
**Post date:** [July 12, 2017, 1:31pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/3 "2017-07-12T13:31:52Z")

</div>

yes I am. Please see below. Do you think using 5.0.1 will resolve the issue?

```
ERROR 2017-07-11 14:09:52,007 [XNIO-1 task-96] com.stardog.http.server.undertow.ErrorHandling:writeError(179): Unexpected error on the server
java.lang.NullPointerException: ColumnOrConst is null.
        at eu.optique.api.mapping.impl.TermMapImpl.<init>(TermMapImpl.java:89) ~[stardog-virtual-api-5.0.jar:?]
        at eu.optique.api.mapping.impl.ObjectMapImpl.<init>(ObjectMapImpl.java:46) ~[stardog-virtual-api-5.0.jar:?]
        at eu.optique.api.mapping.impl.MappingFactoryImpl.createObjectMap(MappingFactoryImpl.java:131) ~[stardog-virtual-api-5.0.jar:?]
        at com.complexible.stardog.virtual.R2RMLUtils.newConstantTermMap(R2RMLUtils.java:234) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.vega.MappedPredicateIndex$MatchedPredicate.<init>(MappedPredicateIndex.java:126) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.vega.MappedPredicateIndex$MatchedPredicate.<init>(MappedPredicateIndex.java:119) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.vega.MappedPredicateIndex.lambda$buildObjectMapIndex$8(MappedPredicateIndex.java:66) ~[stardog-virtual-core-5.0.jar:?]
        at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_131]
        at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080) ~[?:1.8.0_131]
        at com.complexible.stardog.virtual.vega.MappedPredicateIndex.buildObjectMapIndex(MappedPredicateIndex.java:66) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.vega.MappedPredicateIndex.<init>(MappedPredicateIndex.java:45) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.vega.VegaVirtualGraph.<init>(VegaVirtualGraph.java:166) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry._add(DefaultVirtualGraphRegistry.java:197) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.virtual.DefaultVirtualGraphRegistry.add(DefaultVirtualGraphRegistry.java:117) ~[stardog-virtual-core-5.0.jar:?]
        at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.addVG(VirtualGraphHttpService.java:257) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
        at com.complexible.stardog.protocols.http.server.virtual.admin.VirtualGraphHttpService.add(VirtualGraphHttpService.java:105) ~[stardog-virtual-protocols-http-server-5.0.jar:?]
        at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$91(ExtractRoutes.java:186) ~[stardog-protocols-http-server-5.0.jar:?]
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) ~[shiro-core-1.2.3.jar:1.2.3]
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) ~[shiro-core-1.2.3.jar:1.2.3]
        at com.stardog.http.server.undertow.ErrorHandling.lambda$safeDispatch$46(ErrorHandling.java:70) ~[stardog-protocols-http-server-5.0.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
```

---

<div class="post-metadata">

**Author:** ![jafarpour](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jafarpour](https://community.stardog.com/u/jafarpour)\
**Post date:** [July 12, 2017, 2:40pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/4 "2017-07-12T14:40:42Z")

</div>

> [@jafarpour](#):
>
> yes I am. Please see below. Do you think using 5.0.1 will resolve the issue?

Switching to 5.0.1 did not help ☹

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [July 12, 2017, 4:47pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/5 "2017-07-12T16:47:22Z")

</div>

Are you able to share your mappings, either here or in private?

---

<div class="post-metadata">

**Author:** ![jafarpour](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@jafarpour](https://community.stardog.com/u/jafarpour)\
**Post date:** [July 12, 2017, 6:04pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/6 "2017-07-12T18:04:51Z")

</div>

In my experience, all the **predicateMaps** produce the same error. Here is my map:

```
<#abc>
                a rr:TriplesMap;
                rr:logicalTable [rr:tableName "product"];
                rr:subjectMap [
                                rr:template "http://www.abc.com/ontologies/prod/{\"PROD_ID\"}";
                                rr:class ex:Product;
                ];
                rr:predicateObjectMap [
                    rr:predicateMap [rr:template "http://www.abc.com/ontologies/prop/{\"PROPERTY_NAME\"}";]
                    rr:objectMap [rr:column "\"PROPERTY_VALUE\""; rr:datatype xsd:string]
                ].
```

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [July 13, 2017, 11:21pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/7 "2017-07-13T23:21:51Z")

</div>

Template (and column) predicate maps will be supported in the next release.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [July 27, 2017, 11:22pm UTC](https://community.stardog.com/t/predicatemaps-issue-in-r2rml/453/8 "2017-07-27T23:22:04Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
