Kurrawong / rdf2geojson

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Questions about RDF->GeoJSON properties conversion #2

Open ashleysommer opened 2 months ago

ashleysommer commented 2 months ago

I didn't know whether to make these as a single thread or multiple. I'll keep them all together for now, but we may split them into separate issues down the track.

1) Multiple values for a single property Eg, if a object has rdf:type tern:FeatureOfInterest and rdf:type tern:Site. In the current implementation, the prefix is stripped from the property name, and only the first value is emitted in the GeoJSON properties list:

"properties" {
  "type": "https://w3id.org/tern/ontologies/tern/FeatureOfInterest"
  /* rdf:type: tern:Site is lost */
}

2) Property names with the same suffix but different prefix Eg, if an object has values for foaf:member, skos:member, and schema:member. Currently the prefix is stripped from the property name, so only "member" is used as the key. The converter does process each property, but overwrites the previous with the same key.

"properties" {
  /* property schema:member is used */
  "member": "https://example.org/my/shema/member"
  /* property foaf:member is lost */
  /* property skos:member is lost */
}

3) BNode Values Consider the case where the value for a property is defined as a BNode, eg: ex:size [ rdf:value 25.6 ; qudt:unit "mm" ] How should this be expressed in JSON properties? Can it be like this?:

"properties" {
  "size": {
    "value": 25.6,
    "unit": "mm"
  }
}
ashleysommer commented 2 months ago

Problem number 2 above is resolved by one of the new features in https://github.com/Kurrawong/rdf2geojson/pull/3 JSON-LD-like @context is used to keep a mapping of prefix->namespace, and properties are prefixed where possible.