Open VladimirAlexiev opened 1 year ago
@VladimirAlexiev, thanks for your thorough review. A few quick notes:
- The
city:CityJson
type is wrong
Yes, you're absolutely right.
- but
city:hasVertex
is unordered in turtle
This is only half-done. The idea is to assign blank node ids to the vertices and the use them as references in the boundaries
; however, I got stuck due to the flexible nature of boundaries
, which can have anywhere between 0 and... 5? levels of nesting, depending on the type of geometry.
In any case, is the order of the vertices relevant (I'm honestly asking, since I'm not a CityJSON guru by any means)? Unless I'm mistaken, the order of the vertices is only important to the extent that the references in other constructs (e.g. boundaries
) are consistent. In this example (bear with me for a second and imagine that the boundaries
arrays and untangled), the boundaries
would use blank node ids to refer to the specific vertices (to which rdflib would assign, in turn, blank node ids, instead of leaving them unlabeled as they are right now).
A RDF -> CityJSON converter could then just revert the process by defining an order (lexicographically?) to sort the vertices, mapping them to their position in the vertices
array and replacing the references (e.g. boundaries
) with the corresponding indexes.
Ontology terms are defined with relative URL in the context, resulting in local file: URLs in turtle
This is a bug in the pyld module (it's not expanding the terms as it should). I have pushed a workaround for this, so (fingers crossed) no more file:// URIs.
boundaries have a similar structure to vertices (list of numeric triples), but city:hasVertex vs city:boundaries have very different structure
Explained above.
city:hasVertex vs city:boundaries don't use a consistent naming convention
Agreed.
city:lod "2" may be better rendered as a number
Fixed by setting the @type
.
city:hasTransform, city:translate are defined as xsd:float or double
Added the necessary @type
's for rdflib to serialize it as xsd:decimal.
Nested blank nodes are not formatted well
This is just how rdflib serializes Turtle...
an important root object "Building_1" is missing from the turtle
The identifiers for the objects are used to generate the blank node ids; if you look at the ttl file, you'll see two different city objects ([1], [2]).
Of course, that should also be done for the parents
and children
as well, but as I said, this is all still far from complete.
@avillar Can you please open a new issue "how to represent geometry (vertices and indexes)"? It's crucial for the whole effort. Please add this info:
these extra considerations:
rdf:rest*/rdf:first
but there's no guarantee they will be in order@rob-metalinkage and @peterrdf What's your take on geometry?
identifiers for the objects are used to generate the blank node ids;
Ah, but they should be used to make URLs (and perhaps emitted in a separate field identifier
), not merely to distinguish the blank nodes.
Quick note: the nested lists issue was not really a JSON-LD 1.0 vs 1.1, but a problem with the rdflib JSON-LD parser...
@avillar @rob-metalinkage @peterrdf Here's an initial list of issues from about 20 min inspection of the example json/turtle.
Conventions:
blob/c46b466e036857a719f31ae47c4753637f9ca248
notblob/master
). As https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet describes, you can copy this link by using... > Copy permalink
(don't copy from the address bar). Let's adopt this convention since it's very convenient to see the snippetsIssues:
chek-profiles
to perhapsCityRDF-examples
. I don't think our project controller will look nicely at me working on some other project's repo/stuff. Also, I feel it's prestigious to work on an RDF/OWL rendition of CityGML, but not so on somebody else's project.city:CityJson
type is wrong, because the turtle result is NOT json. Maybe rename this type toCityGML
orCityData
? https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L23city:hasVertex
is unordered in turtle https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L44-L46file:
URLs in turtle: https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L34boundaries
have a similar structure tovertices
(list of numeric triples), butcity:hasVertex
vscity:boundaries
have very different structure: https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L44 vs https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L32city:hasVertex
vscity:boundaries
don't use a consistent naming convention (I prefer justvertex, boundary
)city:lod "2"
may be better rendered as a number (2
or even2.0
) so one can compare LODs numerically https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L33city:hasTransform, city:translate
are defined asxsd:float
ordouble
, leading to inexact numeric representation and scientific notation. Maybe better define asxsd:decimal
? https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L41city:x
doesn't start in the same position ascity:y, city:z
: https://github.com/ogcincubator/chek-profiles/blob/c46b466e036857a719f31ae47c4753637f9ca248/cityjson/twobuildings.city.ttl#L24-L29