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

Move some metamorph functions into metafacture-core #1097

Closed
dr0i opened this issue Dec 15, 2020 · 5 comments
Closed

Move some metamorph functions into metafacture-core #1097

dr0i opened this issue Dec 15, 2020 · 5 comments
Assignees
Labels
Projects

Comments

@dr0i
Copy link
Member

dr0i commented Dec 15, 2020

Thse three metamorph functions in lobid-resource may become part of metafacture-core:
urlescape , sanitizeUrl ,dateformat

This may be enough to get rid of lobid-resources' own metamorph.xsd.

@dr0i dr0i self-assigned this Dec 15, 2020
@dr0i dr0i added this to Backlog in lobid board via automation Dec 15, 2020
@dr0i dr0i moved this from Backlog to Ready in lobid board Dec 15, 2020
@TobiasNx
Copy link
Contributor

TobiasNx commented Oct 4, 2022

Does this make seens to migrate them to fix? @dr0i

@dr0i
Copy link
Member Author

dr0i commented Oct 4, 2022

As we will switch to fix, I would say so. Question is: are these functions ok to be integrated in fix (thinking of catmandu API etc.)?

@TobiasNx
Copy link
Contributor

TobiasNx commented Oct 6, 2022

If these are usable as the following examples. In my opinion this is okay:

  <element name="urlescape">
    <annotation>
      <documentation>URL escaping using the gdata library to savely escape URIs as defined in RFC 3986 .
      </documentation>
    </annotation>
    <complexType/>
  </element>

Fix:
url_escape("<sourceField>")

  <element name="sanitizeUrl">
    <annotation>
      <documentation>Checks if value is a valid URL. If not, try to repair it. If that's not possible, emit an empty string.
      </documentation>
    </annotation>
    <complexType/>
  </element>

Fix:
sanitize_url("<sourceField>")

<element name="dateformat">
  <annotation>
    <documentation>Format a date in a specific format.</documentation>
  </annotation>
  <complexType>
    <attribute name="inputformat" type="string" use="optional" default="dd.MM.yyyy"/>
    <attribute name="fallback" type="string" use="optional"/>
    <attribute name="outputpattern" type="string" use="optional"/>
    <attribute name="outputformat" use="optional" default="LONG">
      <simpleType>
        <restriction base="string">
          <enumeration value="FULL"/>
          <enumeration value="LONG"/>
          <enumeration value="MEDIUM"/>
          <enumeration value="SHORT"/>
        </restriction>
      </simpleType>
    </attribute>
    <attribute name="era" use="optional" default="AUTO">
      <simpleType>
        <restriction base="string">
          <enumeration value="AUTO"/>
          <enumeration value="AD"/>
          <enumeration value="BC"/>
        </restriction>
      </simpleType>
    </attribute>
    <attribute name="removeLeadingZeros" type="boolean" use="optional" default="false"/>
    <attribute name="language" type="string" use="optional"/>
  </complex

date_format("", [input_format:"<input_format>", other_options: ...]")`

Also date_format could help if expanded to a datetime_format with: metafacture/metafacture-fix#256 (comment)

@TobiasNx TobiasNx added the ALMA label Oct 6, 2022
@TobiasNx
Copy link
Contributor

TobiasNx commented Apr 9, 2024

@dr0i should we close this ticket, we are not using morph anymore in lobid and the fix we are using is no specific lobid fix

@dr0i
Copy link
Member Author

dr0i commented Apr 9, 2024

ACK. Also some of these functions are now available in fix, e.g. uri_encode and timestamp.
Closing.

@dr0i dr0i closed this as completed Apr 9, 2024
lobid board automation moved this from Ready to Done Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants