-
Notifications
You must be signed in to change notification settings - Fork 33
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
Allow all of the entities in the metadata to be ordered #316
Comments
Thanks, @laijasmine And just to clarify, the issue here is that the schema model in the EML XSD for dataset is:
So, the entities can come in any order and is under author control. The R EML package should not be reordering these elements, as the order may have meaning or utility to the author. Other XML tools in other languages routinely preserve this order, and this seems to be an implementation issue in likely the |
Looks like something we can fix.
but when serialized, two things happen: 1 The entity types are grouped together, breaking user-specified order The routine we use in |
Yup, I'm not sure there's a straight-forward solution here. This semantic assertion being made by Like @amoeba , this has the nice side-effect that a user doesn't need to remember which is the right ordering; though of course a smart enough tool should be able to preserve that feature while still preserving the user's ordering. The question in my mind is then how does one go about capturing the semantically meaningful ordering explicitly in the JSON representation, so that it can be preserved? Not to dismiss the issue, but I'm not quite sure I understand the use case(s) for controlling the order. I don't tend to think of the raw XML as being a 'display' format, and it seems like it should be possible to control the display (in say, an HTML rendering) independent of the order. In my experience, it is usually better to make, say, the relationship between |
Thanks @cboettig.
The purpose is here, as I understand it, is to control the display/rendering of the data in the XML within a web context (on our data catalog). Is that about right @laijasmine? If you have an example of a dataset where you'd like to see the entity types interspersed amongst each other, it might help here too. So I think you're right in pointing out that there are more appropriate ways than tweaking the serialization order to get the desired effect. Unfortunately, we don't have something that seems like the right fit to do this at the moment. |
Thanks @cboettig My take on this is that, by using JSON-LD as our internal representation, we have a lossy intermediate format that drops some of the explicit semantics that is present in XML. In XML parsers, repeating elements are always preserved in document order (although attributes are explicitly not). This is the basis on which XPath predicates work, as they have predicate selectors (e.g., the second creator child |
@mbjones yes, that's precisely what I was trying to say, too. I think JSON-Ld format is explicitly lossy, and though you could probably still hack around it, the JSON-LD representation would really need to supplanted to be a compliant XML parser. I guess I was arguably trying to suggest that this bug is a feature, as it doesn't allow you to encode information in ordering even though XML allows that (e.g. for comparison NeXML explicitly cites being order-independent to be consistent with semantic principles, even though it's also based on XML -- just because order is inherit to XML does not mean it must be respected by a of an XML-based standard). Of course EML doesn't make such assertions, but nor does it define an explicit meaning that is supposed to be implied by the order. In general, I think there's value in making the implicit relationship suggested above more explicit in metadata, and I think there is value in separating issues of presentation/appearance from issues of meaning. All of which is to say that I actually don't think it would be that hard to do a list-based EML without the |
When we use
read_eml
it groups the entity types into lists. Currently, it is not possible for users trying to edit metadata using this package to specify the order of all the entities (spatialVector,
,dataTable
,otherEntity
etc.) .We can modify the order within a group (for example, all of the
dataTables
):However, if you want to have it display with the different entity types inter-dispersed it is not possible:
The text was updated successfully, but these errors were encountered: