Skip to content
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

[md2orchestra] Invalid usage of dcterms name space in metadata element #62

Open
JThoennes opened this issue Jan 28, 2022 · 7 comments
Open
Assignees
Labels
wontfix This will not be worked on

Comments

@JThoennes
Copy link

Comparing the output of md2orchestra to the Orchestra file of FIX Latest, I see some notable differences: While the Orchestra FIX Latest only uses the dc: XML name space,
the generated XML code uses dcterms: which causes validation errors in my IDE.

I think that the <fixr:metadata> elements only allows <dc:*>. The Orchestra FIX Latest adheres to this restriction:

<?xml version="1.0" encoding="UTF-8"?>
<fixr:repository xmlns:dc="http://purl.org/dc/elements/1.1/"
                 xmlns:fixr="http://fixprotocol.io/2020/orchestra/repository"
                 xmlns:xs="http://www.w3.org/2001/XMLSchema"
                 name="FIX.Latest"
                 version="FIX.Latest_EP269">
   <fixr:metadata>
      <dc:title>Orchestra</dc:title>
      <dc:creator>unified2orchestra.xslt script</dc:creator>
      <dc:publisher>FIX Trading Community</dc:publisher>
      <dc:date>2021-08-14T22:38:48.950856Z</dc:date>
      <dc:format>Orchestra schema</dc:format>
      <dc:source>FIX Unified Repository</dc:source>
      <dc:rights>Copyright (c) FIX Protocol Ltd. All Rights Reserved.</dc:rights>
   </fixr:metadata>

while the generated code looks like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fixr:repository xmlns:dc="http://purl.org/dc/elements/1.1/"
                 xmlns:dcterms="http://purl.org/dc/terms/"
                 xmlns:fixr="http://fixprotocol.io/2020/orchestra/repository"
                 name="Rules of Engagement of the FIX Trading Adapter 1.0 1.0"
                 version="1.0">
    <fixr:metadata>
        <dcterms:title>Rules of Engagement of the FIX Trading Adapter</dcterms:title>
        <dcterms:creator>Jörg Thönnes</dcterms:creator>
        <dcterms:publisher>aixigo AG, Aachen, Germany</dcterms:publisher>
        <dcterms:language>English</dcterms:language>
        <dcterms:source>aixigo-fix-orchestra.xml</dcterms:source>
        <dcterms:rights>Copyright (C) 2022, aixigo AG, Aachen, Germany</dcterms:rights>
    </fixr:metadata>

I think the problem is the Tablature RepositoryMapper.getPreferredPrefix(). The dcterms case should be removed.
Then both the XML name space declaration is dropped and the dc: prefix is used.

@JThoennes
Copy link
Author

@donmendelson Do you think I am correct here? Do I missing something?

@donmendelson
Copy link
Member

The Dublin Core XML namespaces are a bit confusing.

dc.xsd has target namespace "http://purl.org/dc/elements/1.1/"
dcterms.xsd has target namespace "http://purl.org/dc/terms/". But it also imports dc.xsd.

Therefore, many of the terms, such as subject can be valid in both namespaces.

@JThoennes
Copy link
Author

So I wonder why the official Orchestra FIX Latest XML does use the other way?
In addition, my IDE complains about the dcterms: usage so I would prefer to have it in one common way.

@kleihan kleihan changed the title Invalid usage of dcterms name space in metadata element [md2orchestra] Invalid usage of dcterms name space in metadata element Sep 5, 2022
@kleihan kleihan added the enhancement New feature or request label Sep 6, 2022
@donmendelson
Copy link
Member

A bit more detail on namespaces:

A complete explanation of Dublin Core Terms Initiative namespaces is here:
Namespace Policy for the Dublin Core™ Metadata Initiative (DCMI)

In short...

  • http://purl.org/dc/elements/1.1/ namespace is a subset of original 15 terms
  • http://purl.org/dc/dcmitype/ enumerates types
  • http://purl.org/dc/terms/ imports the above into its own namespace

Therefore only http://purl.org/dc/terms/ should be necessary for our purposes.

@donmendelson
Copy link
Member

The Orchestra repository schema defines metadata element like this;

<xs:element name="metadata" type="dcterms:elementOrRefinementContainer"/>

and the dcterms namespace is defined like this:

xmlns:dcterms="http://purl.org/dc/terms/"

Therefore, I believe the repository schema is using the correct namespace.

The FIX Latest file (EP 272) in the orchestrations repository also defines the namespace as

xmlns:dcterms="http://purl.org/dc/terms/"

This is also correct.

@JThoennes, the file you referred to was produced by a different process (XSLT) while starting with EP272 we started publishing a file produced with a Python script. In short, I believe that the problem has been resolved, at least in this instance.

Nevertheless, we need to examine how other tools that write Orchestra files are managing namespaces. This has always been one of the tricky aspects of XML schema usage, and I thank you for bringing it to our attention.

@donmendelson
Copy link
Member

One last comment on namespaces: when an XML namespace is declared in an XML file with xmlns, only the URI following the equal sign has universal significance. The prefix before the equal sign is an alias for the namespace that has scope only for that XML file. Therefore, a different prefix can be used, but the only thing that really matters is that it points to the correct URI.

@donmendelson donmendelson added wontfix This will not be worked on and removed enhancement New feature or request labels Sep 8, 2022
@JThoennes
Copy link
Author

Thanks, @donmendelson, for your detailed answer! Did not visit this space for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
Status: No status
Development

No branches or pull requests

3 participants