Value objects and jsonld framing

Hi,

I’m trying to use jsonld framing to get a clean and stable json output that can be used in applications that don’t have any particular understanding of jsonld.

My issues is that the java library I’m using keeps trying to convert literals to their minimal representation:

 :a :b “hello”

  becomes: “hello”

While 

	:a :b “hello”@en

		Becomes : {“@value":”hello”, “@language”:”hello”}


I would like to specify property by property how this should be handled. In essence, forcing the latter (value object) representation.

I’ve included some example data and my framing at the bottom of this email.

Thank you for any help.

Regards,
Håvard




############# DATA ################

@prefix schema: <http://schema.org/> .
@prefix difiMeta: <http://dcat.difi.no/metadata/> .
@prefix adms:  <http://www.w3.org/ns/adms#> .
@prefix dct:   <http://purl.org/dc/terms/> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix skos:  <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix dcat:  <http://www.w3.org/ns/dcat#> .
@prefix foaf:  <http://xmlns.com/foaf/0.1/> .

<http://nobelprize.org/datasets/dcat#dist1>
        dct:description  "Provides browsable linked data and a SPARQL endpoint."@en ;
        dcat:inDataset   <http://nobelprize.org/datasets/dcat#ds1> .

<http://nobelprize.org/datasets/dcat#ds1>
        dct:description  "This dataset contains Nobel prizes, Nobel laureates and information about related media resources. " ;
        dct:issued       "2014-01-15"^^<http://www.w3.org/2001/XMLSchema#date> ;
        dcat:inCatalog   <http://nobelprize.org/datasets/dcat#catalog> .

<http://nobelprize.org/datasets/dcat#catalog>
        dct:description  "A range of datasets maintained by Nobel Media AB " ;
        dct:issued       "2014-09-25"^^<http://www.w3.org/2001/XMLSchema#date> .

<http://nobelprize.org/categoryScheme/cs1>
        dct:description  "Private scheme"@en .



############ FRAME ###############

{
 "@context": {
   "foaf": "http://xmlns.com/foaf/0.1/",
   "dct": "http://purl.org/dc/terms/",
   "dcat": "http://www.w3.org/ns/dcat#",
 "issued" : {
       "@id" : "http://purl.org/dc/terms/issued",
       "@type" : "http://www.w3.org/2001/XMLSchema#date"
  },
 "description" : {
  "@container":"@set", 
       "@id" : "http://purl.org/dc/terms/description"
 },
 "modified" : {
       "@id" : "http://purl.org/dc/terms/modified",
       "@type" : "http://www.w3.org/2001/XMLSchema#date"
     }
}
,
"dcat:inDataset": {
  "@embed": true 
}
}



######### CURRENT OUTPUT ############
{
  "@context" : {
    "foaf" : "http://xmlns.com/foaf/0.1/",
    "dct" : "http://purl.org/dc/terms/",
    "dcat" : "http://www.w3.org/ns/dcat#",
    "issued" : {
      "@id" : "dct:issued",
      "@type" : "http://www.w3.org/2001/XMLSchema#date"
    },
    "description" : {
      "@id" : "dct:description",
      "@container" : "@set"
    },
    "modified" : {
      "@id" : "dct:modified",
      "@type" : "http://www.w3.org/2001/XMLSchema#date"
    }
  },
  "@graph" : [ {
    "@id" : "http://nobelprize.org/datasets/dcat#dist1",
    "description" : [ {
      "@language" : "en",
      "@value" : "Provides browsable linked data and a SPARQL endpoint."
    } ],
    "dcat:inDataset" : {
      "@id" : "http://nobelprize.org/datasets/dcat#ds1",
      "description" : [ "This dataset contains Nobel prizes, Nobel laureates and information about related media resources. " ],
      "issued" : "2014-01-15",
      "dcat:inCatalog" : {
        "@id" : "http://nobelprize.org/datasets/dcat#catalog",
        "description" : [ "A range of datasets maintained by Nobel Media AB " ],
        "issued" : "2014-09-25"
      }
    }
  } ]
}



######### REQUIRED OUTPUT ############

{
  "@context" : {
    "foaf" : "http://xmlns.com/foaf/0.1/",
    "dct" : "http://purl.org/dc/terms/",
    "dcat" : "http://www.w3.org/ns/dcat#",
    "issued" : {
      "@id" : "dct:issued",
      "@type" : "http://www.w3.org/2001/XMLSchema#date"
    },
    "description" : {
      "@id" : "dct:description",
      "@container" : "@set"
    },
    "modified" : {
      "@id" : "dct:modified",
      "@type" : "http://www.w3.org/2001/XMLSchema#date"
    }
  },
  "@graph" : [ {
    "@id" : "http://nobelprize.org/datasets/dcat#dist1",
    "description" : [ {
      "@language" : "en",
      "@value" : "Provides browsable linked data and a SPARQL endpoint."
    } ],
    "dcat:inDataset" : {
      "@id" : "http://nobelprize.org/datasets/dcat#ds1”,


/* THIS LINE BELOW SHOULD BE CONVERTED TO AN OBJECT */

      "description" : [{ “@value”:"This dataset contains Nobel prizes, Nobel laureates and information about related media resources. “} ],
      "issued" : "2014-01-15",
      "dcat:inCatalog" : {
        "@id" : "http://nobelprize.org/datasets/dcat#catalog”,


/* THIS LINE BELOW SHOULD BE CONVERTED TO AN OBJECT */


        "description" : [{“@value”:"A range of datasets maintained by Nobel Media AB "}],
        "issued" : "2014-09-25"
      }
    }
  } ]
}

Received on Thursday, 21 January 2016 18:45:39 UTC