-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to "retype" rdf:JSON to geo:geoJSONLiteral? #425
Comments
It seems dangerous to retype all encountered I'm struggling to think of why you might need this to have happened, at any time other than during a query, at which point SPARQL/GeoSPARQL always lets you coerce/cast the datatype you want (assuming it's a "natural" transformation, which would be the case if Would that not be sufficient? |
This issue was discussed in a meeting.
|
To Benjamin Young (Github finds 23 users of that name so I don't know whom to ping):
To @gkellogg
To @TallTed:
Notes:
In summary: I don't think it's appropriate for JSON-LD to question other standard group's decisions on what to keep as literals and what to break down into triples. Cheers! |
I believe you're looking for @BigBlueHat
That GeoSPARQL Benchmark belongs to OpenLink Software, my employer; it is not "[my] own". "Sudden resistance"? Conversation sparks thoughts, which get "voiced" in IRC. I think you're reading more into those thoughts/comments than was meant. Also, it appears that you may have misread my "probably better" to have been saying that Still, I see no problem with raising the possibility of Interestingly, RFC7946, The GeoJSON Format, which has no "obsoleted by", does not contain the string
I don't think it's appropriate for anyone to tell me (nor the JSON-LD WG) that I (we) cannot break some literal(s) into triples. Whether that anyone chooses to consume or otherwise make use of the triples I (we) have derived from those literals is up to them.
I think this has already been answered. In general, "key |
@TallTed GeoJSON is not obsoleted by GeoSPARQL: it is incorporated into it.
This approach will break established implementation practices (semantic repositories that follow the GeoSPARQL standard to handle geometries). What would be the benefit of doing that?
How? That's exactly the possibility I'm asking for. |
Anyone can mint their own "@context": {
"geo": "http://www.opengis.net/ont/geosparql#",
"myGeom": {"@id": "geo:asGeoJSONLiteral", "@type": "geo:geoJSONLiteral"}
} — or perhaps better — "@context": {
"myGeom": {"@id": "http://www.opengis.net/ont/geosparql#asGeoJSONLiteral",
"@type": "http://www.opengis.net/ont/geosparql#geoJSONLiteral"}
} Note that Although... I can find nothing that discusses the You may need to remove or edit any existing |
Hi @TallTed! Please read https://w3c.github.io/json-ld-syntax/#json-literals. Let's try at the playground: https://tinyurl.com/287gzb57 {
"@context": {
"@version": 1.1,
"geo": "http://www.opengis.net/ont/geosparql#",
"asGeoJSON": {"@id": "geo:asGeoJSON", "@type": "@json"}
},
"asGeoJSON": [1,2,3]
} returns what I want, except for the generic datatype: _:b0 <http://www.opengis.net/ont/geosparql#asGeoJSON> "[1,2,3]"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON> . If I follow your suggestion: {
"@context": {
"@version": 1.1,
"geo": "http://www.opengis.net/ont/geosparql#",
"asGeoJSON": {"@id": "geo:asGeoJSON", "@type": "geo:geoJSONLiteral"}
},
"asGeoJSON": [1,2,3]
} then the geometry is broken into individual triples, something I don't want: _:b0 <http://www.opengis.net/ont/geosparql#asGeoJSON> "1"^^<http://www.opengis.net/ont/geosparql#geoJSONLiteral> .
_:b0 <http://www.opengis.net/ont/geosparql#asGeoJSON> "2"^^<http://www.opengis.net/ont/geosparql#geoJSONLiteral> .
_:b0 <http://www.opengis.net/ont/geosparql#asGeoJSON> "3"^^<http://www.opengis.net/ont/geosparql#geoJSONLiteral> . If the input JSON has a string that looks like a JSON fragment, then sure I can coerce it to a specific datatype: {
"@context": {
"@version": 1.1,
"geo": "http://www.opengis.net/ont/geosparql#",
"asGeoJSON": {"@id": "geo:asGeoJSON", "@type": "geo:geoJSONLiteral"}
},
"asGeoJSON": "[1,2,3]"
} But the input files that I work with (JSON-FG, CityJSON etc) are all JSON, they don't use strings looking like JSON. Now read my original proposal: I want a new key "asGeoJSON": {"@id": "geo:asGeoJSON", "@type": "@json", "@json": "geo:geoJSONLiteral"} Is it more clear now?
Sorry, my mistake, here's the correct prop pointing to the correct datatype: :asGeoJSON
a rdf:Property, owl:DatatypeProperty ;
rdfs:subPropertyOf :hasSerialization;
rdfs:domain :Geometry ;
rdfs:range :geoJSONLiteral ; |
This gets close to what's now in my head after reading all the defense/feedback, though with one key change (for a future version of JSON-LD). {
"@context": {
"asGeoJSON": {"@id": "geo:asGeoJSON", "@type": "geo:geoJSONLiteral", "@json": "object"}
},
"asGeoJSON": { /* raw geojson */ }
} resulting in: _:b0 <geo:asGeoJSON> "{ /* raw geojson */ }"^^<geo:geoJSONLiteral> That proposed format could potentially allow us to more clearly unconflate RDF datatypes and JSON value/format types. The proposed Alternatively, the JSON object storage (vs. processing as more JSON-LD) could be done automatically when objects are detected--though this could result in unexpected processing output if/when errors occurred in the JSON...and undoubtedly makes the "is this bit JSON-LD or just JSON?" a harder question for authors to keep straight. But...could result in this "just working": {
"@context": {
"asGeoJSON": {"@id": "geo:asGeoJSON", "@type": "geo:geoJSONLiteral"}
},
"asGeoJSON": { /* raw geojson */ }
} I'm certain there's issues with that reason that @gkellogg and others can elaborate on, but it may be interesting to explore if/when we could make datatypes more flexible...at least around JSON objects as values. |
@BigBlueHat Thanks for supporting this!
PS: when you take into account the prefix The difference is crucial: there is in fact a |
This relates to work on CDT literals proposed by AWS for SPARQL. Being about to use |
If the need for such "retyping" has been established, can we consider concrete syntaxes to express it? Here are some choices:
@gkellogg what do you think? |
We probably need to think about other use cases that could use the same pattern. Really, the issue is when Another possibility would be to add {
"@context": {
"asGeoJSON": {"@id": "geo:asGeoJSON", "@container": "@json", "@type": "geo:geoJSONLiteral"}
},
"asGeoJSON": { /* raw geojson */ }
} |
It may help others to know that the |
@TallTed have you seen [1] https://www.iana.org/assignments/geo-uri-parameters/geo-uri-parameters.xhtml#geo-uri-parameters-1 |
@dr-shorthair — I was following up on #425 (comment) (which I should have cited). I have not personally seen RFC5870's |
@gkellogg I like |
https://w3c.github.io/json-ld-syntax/#json-literals shows how a piece of the JSON can be captured as datatyped literal
"..."^^rdf:JSON
@situx @nicholascar @mathib @dr-shorthair
opengeospatial/ogc-geosparql#1 discusses the new GeoSPARQL 1.1 geo:geoJSONLiteral. According to the standard, such geometry serialization must both be connected by a specific property, and carry a specific datatype:
@gkellogg Is it possible to somehow "retype" a
rdf:JSON
literal to a specific datatypegeo:geoJSONLiteral
?It's easy enough to do this post-factum (eg with a SPARQL update), but seems unsatisfactory...
Perhaps something like this can be added:
Notice the last key: this is similar to
"@nest": "labels"
in https://w3c.github.io/json-ld-syntax/#example-defining-property-nestingThe text was updated successfully, but these errors were encountered: