Hey,

when printing the N-Quads of titanium i get:
_:b0 <http://purl.org/dc/terms/description> "Allows to register a new 
resource." .
_:b0 <https://www.w3.org/2019/wot/td#hasForm> _:b1 .
_:b0 <https://www.w3.org/2019/wot/td#hasInputSchema> _:b2 .
_:b0 <https://www.w3.org/2019/wot/td#hasOutputSchema> _:b3 .
_:b0 <https://www.w3.org/2019/wot/td#hasUriTemplateSchema> _:b4 .
_:b0 <https://www.w3.org/2019/wot/td#name> "addNewResource" .
_:b1 <http://www.w3.org/2011/http#methodName> "POST" .
_:b1 <https://www.w3.org/2019/wot/hypermedia#forContentType> "application/json" 
.
_:b1 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#invokeAction> .
_:b10 <http://www.w3.org/2011/http#methodName> "GET" .
_:b10 <https://www.w3.org/2019/wot/hypermedia#forContentType> 
"application/json" .
_:b10 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#readProperty> .
_:b10 <https://www.w3.org/2019/wot/hypermedia#hasTarget> 
<http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties/databaseRunning>
 .
_:b11 <https://www.w3.org/2019/wot/hypermedia#forContentType> 
"application/json" .
_:b11 <https://www.w3.org/2019/wot/hypermedia#forSubProtocol> "longpoll" .
_:b11 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#observeProperty> .
_:b11 <https://www.w3.org/2019/wot/hypermedia#hasTarget> 
<http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties/databaseRunning/observable>
 .
_:b12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://w3id.org/saref#OnOffState> .
_:b12 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://www.w3.org/2019/wot/json-schema#StringSchema> .
_:b12 <https://www.w3.org/2019/wot/td#hasForm> _:b13 .
_:b12 <https://www.w3.org/2019/wot/td#name> "status" .
_:b13 <https://www.w3.org/2019/wot/hypermedia#forContentType> 
"application/json" .
_:b13 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#readProperty> .
_:b13 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#writeProperty> .
_:b13 <https://www.w3.org/2019/wot/hypermedia#hasTarget> 
<http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties/status> .
_:b14 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://www.w3.org/2019/wot/security#BasicSecurityScheme> .
_:b14 <https://www.w3.org/2019/wot/security#in> "header" .
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://www.w3.org/2019/wot/json-schema#ObjectSchema> .
_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://www.w3.org/2019/wot/json-schema#StringSchema> .
_:b4 <https://www.w3.org/2019/wot/td#name> "resource" .
_:b4 <https://www.w3.org/2019/wot/td#type> "string" .
_:b5 <https://www.w3.org/2019/wot/hypermedia#forContentType> "application/json" 
.
_:b5 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/hypermedia#readallproperty> .
_:b5 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/hypermedia#readmultipleproperty> .
_:b5 <https://www.w3.org/2019/wot/hypermedia#hasTarget> 
<http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/all/properties> .
_:b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://w3id.org/saref#Temperature> .
_:b6 <http://purl.org/dc/terms/description> "Temperature" .
_:b6 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://www.w3.org/2019/wot/json-schema#NumberSchema> .
_:b6 <https://www.w3.org/2019/wot/json-schema#readOnly> 
"true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
_:b6 <https://www.w3.org/2019/wot/td#hasForm> _:b7 .
_:b6 <https://www.w3.org/2019/wot/td#hasForm> _:b8 .
_:b6 <https://www.w3.org/2019/wot/td#isObservable> 
"true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
_:b6 <https://www.w3.org/2019/wot/td#name> "Temperature" .
_:b7 <http://www.w3.org/2011/http#methodName> "GET" .
_:b7 <https://www.w3.org/2019/wot/hypermedia#forContentType> "application/json" 
.
_:b7 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#readProperty> .
_:b7 <https://www.w3.org/2019/wot/hypermedia#hasTarget> 
<http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties/Temperature>
 .
_:b8 <https://www.w3.org/2019/wot/hypermedia#forContentType> "application/json" 
.
_:b8 <https://www.w3.org/2019/wot/hypermedia#forSubProtocol> "longpoll" .
_:b8 <https://www.w3.org/2019/wot/hypermedia#hasOperationType> 
<https://www.w3.org/2019/wot/td#observeProperty> .
_:b8 <https://www.w3.org/2019/wot/hypermedia#hasTarget> 
<http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties/Temperature/observable>
 .
_:b9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://w3id.org/saref#OnOffState> .
_:b9 <http://purl.org/dc/terms/description> "is database running" .
_:b9 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://www.w3.org/2019/wot/json-schema#BooleanSchema> .
_:b9 <https://www.w3.org/2019/wot/json-schema#readOnly> 
"true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
_:b9 <https://www.w3.org/2019/wot/td#hasForm> _:b10 .
_:b9 <https://www.w3.org/2019/wot/td#hasForm> _:b11 .
_:b9 <https://www.w3.org/2019/wot/td#isObservable> 
"true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
_:b9 <https://www.w3.org/2019/wot/td#name> "databaseRunning" .
<urn:dev:ops:32473-wotdirectory-1234> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<https://w3id.org/saref#Device> .
<urn:dev:ops:32473-wotdirectory-1234> <http://purl.org/dc/terms/title> 
"Directory Service" .
<urn:dev:ops:32473-wotdirectory-1234> 
<http://www.w3.org/2003/01/geo/wgs84_pos#lat> "26.58" .
<urn:dev:ops:32473-wotdirectory-1234> 
<http://www.w3.org/2003/01/geo/wgs84_pos#long> "297.83" .
<urn:dev:ops:32473-wotdirectory-1234> 
<https://www.w3.org/2019/wot/td#hasActionAffordance> _:b0 .
<urn:dev:ops:32473-wotdirectory-1234> <https://www.w3.org/2019/wot/td#hasForm> 
_:b5 .
<urn:dev:ops:32473-wotdirectory-1234> 
<https://www.w3.org/2019/wot/td#hasPropertyAffordance> _:b6 .
<urn:dev:ops:32473-wotdirectory-1234> 
<https://www.w3.org/2019/wot/td#hasPropertyAffordance> _:b9 .
<urn:dev:ops:32473-wotdirectory-1234> 
<https://www.w3.org/2019/wot/td#hasPropertyAffordance> _:b12 .
<urn:dev:ops:32473-wotdirectory-1234> 
<https://www.w3.org/2019/wot/td#securityDefinitions> _:b14 .

So i thought turning the writer into an inputstream and reading it into dataset 
with RDFDataMgr.read would do it's job
                InputStream writerStream = new 
ByteArrayInputStream(writer.toString().getBytes(StandardCharsets.UTF_8));
                RDFDataMgr.read(dataset, writerStream, Lang.NQUADS);

But i get: 
Exception in thread "main" 
org.apache.jena.ext.com.google.common.util.concurrent.ExecutionError: 
java.lang.NoClassDefFoundError: org/apache/commons/codec/digest/MurmurHash3
        at 
org.apache.jena.ext.com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
        at 
org.apache.jena.ext.com.google.common.cache.LocalCache.get(LocalCache.java:3962)
        at 
org.apache.jena.ext.com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4859)
        at 
org.apache.jena.atlas.lib.cache.CacheGuava.getOrFill(CacheGuava.java:58)
        at 
org.apache.jena.riot.lang.BlankNodeAllocatorHash.alloc(BlankNodeAllocatorHash.java:99)
        at 
org.apache.jena.riot.lang.LabelToNode$Alloc.alloc(LabelToNode.java:184)
        at 
org.apache.jena.riot.lang.LabelToNode$Alloc.alloc(LabelToNode.java:178)
        at org.apache.jena.riot.system.MapWithScope.get(MapWithScope.java:74)
        at 
org.apache.jena.riot.system.FactoryRDFStd.createBlankNode(FactoryRDFStd.java:92)
        at 
org.apache.jena.riot.system.ParserProfileStd.createBlankNode(ParserProfileStd.java:214)
        at 
org.apache.jena.riot.system.ParserProfileStd.create(ParserProfileStd.java:257)
        at org.apache.jena.riot.lang.LangNQuads.tokenAsNode(LangNQuads.java:119)
        at org.apache.jena.riot.lang.LangNQuads.parseOne(LangNQuads.java:69)
        at org.apache.jena.riot.lang.LangNQuads.runParser(LangNQuads.java:53)
        at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:43)
        at 
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:180)
        at org.apache.jena.riot.RDFParser.read(RDFParser.java:358)
        at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:348)
        at org.apache.jena.riot.RDFParser.parse(RDFParser.java:295)
        at 
org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:550)
        at 
org.apache.jena.riot.RDFDataMgr.parseFromInputStream(RDFDataMgr.java:721)
        at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:510)
        at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:486)
        at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:476)

any suggestions?

-----Ursprüngliche Nachricht-----
Von: Andy Seaborne <[email protected]> 
Gesendet: Dienstag, 27. Juli 2021 10:57
An: [email protected]
Betreff: Re: Storing ThingDescription in Dataset

It has N-Quads reader and writer, so write the RdfDataset as N-Quads to bytes 
or a string, and parse that. Not ideal at scale but it works; JSON-LD isn't 
streaming anyway.

     Andy

https://issues.apache.org/jira/browse/JENA-1948



On 27/07/2021 06:25, Philipp Leeb wrote:
> Didn't see any way to convert titanium-Dataset to jena-Dataset.
> 
> -----Ursprüngliche Nachricht-----
> Von: Andy Seaborne <[email protected]>
> Gesendet: Sonntag, 25. Juli 2021 18:58
> An: [email protected]
> Betreff: Re: AW: AW: AW: Storing ThingDescription in Dataset
> 
> 
> 
> On 25/07/2021 12:47, Philipp Leeb wrote:
>> Doesn't work either.
> 
> What doesn't work?
> 
>> Is there any other way of how to add my TD in JSOn-LD into my dataset?
> 
> Produce RDF - for JSON-LD 1.1, find a tool to convert it to any other RDF 
> syntax. The JSON-LD playground will do that.
> 
> If it can do file to file, any implementation language will do. Exec a 
> process to do the conversion.
> 
> Or
> 
> http://rdf.greggkellogg.net/distiller
> 
> which offers conversion as a service.
> 
> ----
> 
> There is a JIRA waiting for a contribution:
> 
> https://issues.apache.org/jira/browse/JENA-1948
> 
>       Andy
> 
> 
> 
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Andy Seaborne <[email protected]>
>> Gesendet: Sonntag, 25. Juli 2021 13:17
>> An: [email protected]
>> Betreff: Re: AW: AW: Storing ThingDescription in Dataset
>>
>> Jena prints an error.
>>
>> 2:12:36 ERROR riot            :: invalid term definition: 1.1
>>
>>
>> The playgound says it's JSON-LD 1.1 which is not (yet) supported by 
>> jsonld-java/jsonld-java/. I don't know if it is really using any 1.1 
>> features but the @context requires it.
>>
>> Try
>> https://github.com/filip26/titanium-json-ld
>> (I've not used it)
>>
>> to convert to RDF and read the RDF.
>>
>>        Andy
>>
>> On 25/07/2021 12:00, Philipp Leeb wrote:
>>> Hi Andy,
>>>
>>> this is the JSON-LD:
>>> {"id":"urn:dev:ops:32473-wotdirectory-1234","title":"Directory
>>> Service","properties":{"Temperature":{"description":"Temperature","f
>>> o
>>> r
>>> ms":[{"href":"http://localhost:8082/urn:dev:ops:32473-wotdirectory-1
>>> 2
>>> 3
>>> 4/properties/Temperature","op":["readproperty"],"contentType":"appli
>>> c
>>> a
>>> tion/json","htv:methodName":"GET"},{"href":"http://localhost:8082/urn:
>>> dev:ops:32473-wotdirectory-1234/properties/Temperature/observable","
>>> o
>>> p
>>> ":["observeproperty"],"subprotocol":"longpoll","contentType":"applic
>>> a
>>> t
>>> ion/json"}],"type":"number","observable":true,"readOnly":true,"@type":
>>> "saref:Temperature"},"databaseRunning":{"description":"is database 
>>> running","forms":[{"href":"http://localhost:8082/urn:dev:ops:32473-w
>>> o
>>> t
>>> directory-1234/properties/databaseRunning","op":["readproperty"],"co
>>> n
>>> t
>>> entType":"application/json","htv:methodName":"GET"},{"href":"http://
>>> l
>>> o
>>> calhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties/database
>>> R
>>> u
>>> nning/observable","op":["observeproperty"],"subprotocol":"longpoll","
>>> c
>>> ontentType":"application/json"}],"type":"boolean","observable":true,"
>>> r
>>> eadOnly":true,"@type":"saref:OnOffState"},"status":{"forms":[{"href":"
>>> http://localhost:8082/urn:dev:ops:32473-wotdirectory-1234/properties
>>> /
>>> s
>>> tatus","op":["readproperty","writeproperty"],"contentType":"applicat
>>> i
>>> o
>>> n/json"}],"type":"string","@type":"saref:OnOffState"}},"actions":{"a
>>> d d NewResource":{"description":"Allows to register a new
>>> resource.","forms":[{"href":"http://localhost:8082/urn:dev:ops:32473
>>> -
>>> w
>>> otdirectory-1234/actions/addNewResource{?resource}","op":["invokeact
>>> i
>>> o
>>> n"],"contentType":"application/json","htv:methodName":"POST"}],"uriV
>>> a
>>> r
>>> iables":{"resource":{"type":"string"}},"input":{"type":"object"},"ou
>>> t
>>> p
>>> ut":{"type":"string"}}},"forms":[{"href":"http://localhost:8082/urn:
>>> d
>>> e
>>> v:ops:32473-wotdirectory-1234/all/properties","op":["readallproperty"
>>> ,
>>> "readmultipleproperty"],"contentType":"application/json"}],"security":
>>> ["basic_sc"],"@type":"saref:Device","@context":["https://www.w3.org/
>>> 2
>>> 0
>>> 19/wot/td/v1",{"saref":"https://w3id.org/saref#","om":"http://www.wu
>>> r
>>> v
>>> oc.org/vocabularies/om-1.8/","ssn":"http://www.w3.org/ns/ssn/"}],"se
>>> c u rityDefinitions":{"basic_sc":{"scheme":"basic","in":"header"}}}
>>>
>>> This ist he output of JsonLdProcessor.toRdf:
>>> {
>>>      "@default" : [ {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
>>>        },
>>>        "object" : {
>>>          "type" : "IRI",
>>>          "value" : "https://w3id.org/saref#Device";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasActionAffordance";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b0"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b5"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasPropertyAffordance";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b6"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasPropertyAffordance";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b9"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasPropertyAffordance";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b12"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#securityDefinitions";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b14"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "IRI",
>>>          "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#title";
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "Directory Service",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b0"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#description";
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "Allows to register a new resource.",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b0"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b1"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b0"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasInputSchema";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b2"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b0"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasOutputSchema";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b3"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b0"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasUriTemplateVariable";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b4"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b1"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "htv:methodName"
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "POST",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b6"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
>>>        },
>>>        "object" : {
>>>          "type" : "IRI",
>>>          "value" : "https://w3id.org/saref#Temperature";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b6"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#description";
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "Temperature",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b6"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b7"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b6"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b8"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b6"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#isObservable";
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "true",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#boolean";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b7"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "htv:methodName"
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "GET",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b9"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
>>>        },
>>>        "object" : {
>>>          "type" : "IRI",
>>>          "value" : "https://w3id.org/saref#OnOffState";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b9"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#description";
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "is database running",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b9"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b10"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b9"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b11"
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b9"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#isObservable";
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "true",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#boolean";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b10"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "htv:methodName"
>>>        },
>>>        "object" : {
>>>          "type" : "literal",
>>>          "value" : "GET",
>>>          "datatype" : "http://www.w3.org/2001/XMLSchema#string";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b12"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
>>>        },
>>>        "object" : {
>>>          "type" : "IRI",
>>>          "value" : "https://w3id.org/saref#OnOffState";
>>>        }
>>>      }, {
>>>        "subject" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b12"
>>>        },
>>>        "predicate" : {
>>>          "type" : "IRI",
>>>          "value" : "https://www.w3.org/2019/wot/td#hasForm";
>>>        },
>>>        "object" : {
>>>          "type" : "blank node",
>>>          "value" : "_:b13"
>>>        }
>>>      } ]
>>> }
>>>
>>> And when using:
>>> InputStream in = new
>>> ByteArrayInputStream(JsonLdProcessor.toRdf(exposedThing.toJson().get
>>> B y tes(StandardCharsets.UTF_8))); Dataset dataset = 
>>> DatasetFactory.createTxnMem(); RDFDataMgr.read(dataset, in, 
>>> Lang.JSONLD); RDFDataMgr.write(System.out, dataset, Lang.JSONLD);
>>>
>>> This ist he output:
>>> { }
>>>
>>> Phil
>>>
>>>
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Andy Seaborne <[email protected]>
>>> Gesendet: Sonntag, 25. Juli 2021 12:52
>>> An: [email protected]
>>> Betreff: Re: AW: Storing ThingDescription in Dataset
>>>
>>> Hi Phil,
>>>
>>> That does not look like JSON-LD.
>>>
>>> JSON-LD parsing ignores anything it does not understand, not give an 
>>> error. In your code snippet, no Jena involved,
>>>
>>>        Object compact
>>>
>>> is a jsonld-data object "Dataset" (which isn't a Jena Dataset) with nothing 
>>> in it.
>>>
>>> JSON-LD parsing ignores anything it does not understand, not give an error.
>>>
>>> Jena translates the output of JsonLdProcessor.toRDF to Jena objects. If 
>>> there is an empty input, you get an empty output.
>>>
>>> On 25/07/2021 11:11, Philipp Leeb wrote:
>>>> Hi Andy,
>>>>
>>>> this ist he output when using JsonUtils:
>>>> {
>>>>       "@default" : [ {
>>>>         "subject" : {
>>>>           "type" : "IRI",
>>>>           "value" : "urn:dev:ops:32473-wotdirectory-1234"
>>>>         },
>>>>         "predicate" : {
>>>>           "type" : "IRI",
>>>>           "value" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
>>>>         },
>>>>         "object" : {
>>>>           "type" : "IRI",
>>>>           "value" : "https://w3id.org/saref#Device";
>>>>         }
>>>
>>> That would be in JSON-LD:
>>>
>>> {
>>>       "@id" : "urn:dev:ops:32473-wotdirectory-1234",
>>>       "@type" : "https://w3id.org/saref#Device";
>>> }
>>>
>>> or there needs to be a @context
>>>
>>> Try it at:
>>> https://json-ld.org/playground/
>>>
>>>         Andy
>>>
>>
> 

Reply via email to