-
Notifications
You must be signed in to change notification settings - Fork 19
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
GeoJSON literals for GeoSPARQL #48
Conversation
Fixes #1 |
It seems funny to me that the GeoJSON serialisation is only applicable to geometries that happen to use CRS84. OK, it is mentioned in the documentation. But the ontology itself does not prohibit erroneous usage. Secondly, shouldn't there be a reference to the GeoJSON specification that should be used (ideally a URI) and the exact version of that specification? |
Hi Frans, the reference given in the specification is [RFC 7946] https://tools.ietf.org/html/rfc7946 |
Hi Timo, Yes, I think it is a good idea to add a reference to the applicable specification to the ontology. Perhaps rdfs:seeAlso is an appropriate property to use if we want to do that? |
|
I'm afraid that is a feature of GeoJSON. There was proposal to allow CRS to be indicated in GeoJSON , but the developers were strongly of the opinion that it was best to limit it to the common case seen in most web-mapping applications and platforms, which were exploding in popularity at the time GeoJSON was designed. It was targeted at a distinct market that was judged to be unable and unwilling to go into the details of CRS, and not at professional geographers or cartographers or geodesists. It is all history now - GeoJSON is what it is. Other JSON encodings might be developed which don't have those limitations, potentially as supersets of GeoJSON, but those should not be called 'GeoJSON'. |
Yes, what to do for a GeoJSON-like encoding of data within OGC APIs that use CRSes other than WGS84? I've used a GeoJSON-like format in my DGGs APIs and made up a "crs" property... |
Frankly, I am not a fan of GeoJSON either. I have a hard time imagining why anyone would want to use it. Sure, JSON is a very handy format to use on web pages. But JSON-LD seems much more useful. I think JSON-LD could be even more useful for use with spatial data if GeoSPARQL were to have a proper full geometry model (see issue 42) As it stands, I don´t think we can speak of a GeoJSON serialisation of a GeoSPARQL geometry. It can only serialize a subset of geometries. Hence the suggestion to actually define that subset. But in order to do that it would be good to have a separate CRS property for geometry (see issue 31). |
I think we can, as long as there's a description of how the data is "downscaled" into the lesser content format of GeoJSON. So, the representation a. only works for WGS84 geometries and b. looses semantics of properties so that any properties defined in RDF just become key/value pairs in the GeoJSON with no property definitions, no explicit datatypes etc. I think we should provide this downscaling mapping at the very least to indicate what you loose when you use GeoJSON. In my OGC API implementations, I apparently must use GeoJSON but I have semantic content in the DB so I have to do this downscaling! |
@nicholascar: good to point out the possible loss of information when RDF data are exported to GeoJSON. If GeoJSON support is added to GeoSPARQL, the reverse should also be well thought out: What happens when GeoJSON literals are imported into an RDF storage system / graph store? GeoSPARQL implementers will have to try to make sense of geometry properties in GeoJSON, and loss of information can be incurred in that direction too. It seems to me that GeoJSON support could place a heavy burden on implementers, with a danger of different implementers choosing different solutions. This in turn makes me wonder if we can't place GeoJSON support in a separate module, so that supporting it becomes more optional. I think my main concern with support for GeoJSON literals is that it might impede further development (extension) of the geometry class in GeoSPARQL. |
Well there are currently no GeoSPARQL rules about how to handle any of the GeoSPARQL literals (WKT or GML). There are no ontology conversion functions specified in ontology code. Any functions doing things with the literals, like spatial indexing, are implementation-specific i.e. StarDog perhaps performs some sort of GDAL indexing of WKT & GML literals. So I don't think we - ontology designers - have to worry about this. We just state that GeoJSON literals are a microformat in GeoSPARQL and any handling is implementation specific. If someone wanted to mapp GeoJSON literals to semantic content then that would be a matter for application node, not GeoSPARQL ontology rules. I will be doing something similar with DGGS literals: the ontology doesn't know anything about the DGGS literal content: handling those is also a job for application code, even if they have GeoSPARQL functions specified for them. -- We have plenty of lossy literals in Semantic Web for precedence here. Essentially any microformat that isn't understood by an ontology. This would include custom identifier properties that contain structured information as recommended for use in SKOS. So SKOS doesn't know anything about the internals of the identifier literals... |
I have a question especially concerning OGC API Features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for this to be added to the ontology as long as this and other literal types can also be added to a register of literals
I changed the RDFS Entailment section to use classes of the GeoJSON vocabulary which is used in GeoJSON-LD (https://geojson.org/geojson-ld/) |
After today's discussion I removed the RDFS entailment section part and checked the empty geometry literal which is now defined only as {"geometry":null}. |
It should be
|
Thanks @dr-shorthair it is now corrected |
Are we sure that :geoJSONLiteral should be subclass of rdf:JSON? |
Good point. Even though the literal would just include two keys, in my opinion key ordering is not necessary. But I wonder how others think about it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that we remove rdfs:subClassOf rdf:JSON to avoid the canonicalization requirements of rdf:JSON. gmlLiteral is not a subClassOf rdf:XMLLiteral for this same reason.
I removed the subclass relation for now. If this needs further discussion then we may still do so tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Timo. Looks good.
Good pickups Simon & Matt: I had assumed we would want |
This is just to report that the adoption of this newly defined datatype is being considered in GeoDCAT-AP (see SEMICeu/GeoDCAT-AP#4). Actually, the only concern we have is that the GeoJSON datatype may be dropped or changed in the final version of GeoSPARQL - we are going to release the new version of GeoDCAT-AP shortly, so we cannot wait until then. About the context: GeoDCAT-AP is a profile of the W3C DCAT vocabulary used across Europe to support a DCAT-compliant representation of INSPIRE / ISO 19115 metadata. Some more details are also available in the GeoDCAT-AP OGC Discussion Paper: http://www.opengis.net/doc/dp/GeoDCAT-AP |
It won't be. Everyone wants it included so the only issues are around the datatype formalisms like the conversation above re alignment with |
note/question: is it legal to define subdatatypes in domain ontologies used for reasoning? I always imagined that it is not allowed as there's no |
I have extended the Geometry Extension section of the GeoSPARQL specification to include a definition for a GeoJSON literal.
The ontology has also been extended by a geo:asGeoJSON property and a geo:geoJSONLiteral.
I had the following considerations:
However, how do we define equivalences for POINT(EMPTY), POLYGON(EMPTY) etc.? Is this necessary?
Should we define an empty Point as {"type":"Point","coordinates":[]} a.s.o. ?
I was not sure whether it is needed to extend the RDFS Entailment section.
In my opinion, we could just reuse the Geometry class definitions of SimpleFeatures which were used for defining the WKTLiterals.
But I am open to any other suggestions.