[ 
https://issues.apache.org/jira/browse/JENA-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17284252#comment-17284252
 ] 

Calum Mackervoy commented on JENA-2034:
---------------------------------------

Thanks I looked into this but I think I need the Formula feature from N3 
because I need to refer to the named graph as a property on my resource?

To start at the beginning the Resource I have is a `Task`, it's an extension of 
`time:Interval` (hasBeginning, hasEnd) which needs also a property `endState` 
(a resource of type `solid:Patch`), i.e.

```
{{@prefix solid: <http://www.w3.org/ns/solid/terms#>.}}
{{@prefix log: <http://www.w3.org/2000/10/swap/log#>.}}
{{@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.}}

{{[}}
{{   }}a solid:Patch; 
    solid:patches rdfs:Resource;
   solid:deletes log:Formula;
   solid:inserts log:Formula
].
```

I see how `solid:deletes` and `solid:inserts` can be made into named graphs but 
not how they can be referenced as a property on a Resource ?

> adding GraphNode (N3 formula) to Model (ARQInternalErrorException)
> ------------------------------------------------------------------
>
>                 Key: JENA-2034
>                 URL: https://issues.apache.org/jira/browse/JENA-2034
>             Project: Apache Jena
>          Issue Type: Question
>          Components: ARQ, Jena, RDF API
>    Affects Versions: Jena 3.17.0
>         Environment: * Ubuntu 20.04
>  * Using Eclipse EE
>  * Project is running a Tomcat 9 server
>            Reporter: Calum Mackervoy
>            Priority: Minor
>
> I'm attempting to add a Graph node to a Model (N3 formula)
> The output should be roughly like the below:
> ```
> <http://localhost:8080/patches/#cf0ba48fa8b0421c8b025c3ea6b41a4f>
>  a <http://www.w3.org/ns/solid/terms#Patch> ;
>  <http://www.w3.org/ns/solid/terms#patches>
>  <http://example.com/#me> ;
>  <http://www.w3.org/ns/solid/terms#inserts> \{ http://example.com/#me 
> http://example.com/#property http://example.com/#resource } .
> ```
> Note that the `#inserts` property here is a "GraphNode" or N3 formula, I'm 
> modelling a graph of the triples to write when a `Task` is complete
> I tried the code below:
> ```
> Model out = ModelFactory.createDefaultModel();
> out.add(endState, SolidTerms.inserts, 
> out.asRDFNode(NodeFactory.createGraphNode(inserts.getGraph())));
> ```
> but this throws `[org.apache.jena.sparql.ARQInternalErrorException: Unknown 
> node type: \{http://example.com/#me @http://example.com/#property 
> http://example.com/#resource}]`
> I've tried many other ways of putting the `Graph` in the model with no 
> success, posting this one because it was my first and I think the most 
> rational. I think it's a bug unless Jena just doesn't support the GraphNode 
> type in `RDFNode` ? I spent a few hours searching the documentation and the 
> web before opening this issue
> The `@` in the error output puzzled me a bit, but I checked that it's not 
> included in my property definition, it's maybe added in by the 
> `createGraphNode` or the error serialization



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to