Last active
December 19, 2024 20:51
-
-
Save pgwillia/1447ea135dd21ea137ce7141927db090 to your computer and use it in GitHub Desktop.
https://wiki.lyrasis.org/display/DSDOC7x/Authority+Control+of+Metadata+Values Example submission-forms.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| builder = Nokogiri::XML::Builder.new do |xml| | |
| xml.send('input-forms') { | |
| xml.send('form-value-pairs') { | |
| CONTROLLED_VOCABULARIES[:jupiter_core].keys.each do |vocab_key| | |
| xml.send('value-pairs') { | |
| xml.send('value-pairs-name', vocab_key.to_s) | |
| if Item.rdf_annotation_for_attr(vocab_key).exists? | |
| xml.send('dc-terms',RDF::URI(Item.rdf_annotation_for_attr(vocab_key).first.predicate).pname.to_s) # TODO acts_as_rdfable | |
| else | |
| xml.send('dc-terms',RDF::URI(Thesis.rdf_annotation_for_attr(vocab_key).first.predicate).pname.to_s) # TODO acts_as_rdfable | |
| end | |
| CONTROLLED_VOCABULARIES[:jupiter_core][vocab_key][:data].each_pair do |pair| | |
| xml.pair { | |
| xml.send('display-value', I18n.t("controlled_vocabularies.#{:jupiter_core}.#{vocab_key}.#{pair[0]}", default: pair[0])) | |
| xml.send('stored-value', pair[1]) | |
| } | |
| end | |
| } | |
| end | |
| } | |
| xml.send('form-value-pairs') { | |
| CONTROLLED_VOCABULARIES[:era].keys.each do |vocab_key| | |
| xml.send('value-pairs') { | |
| xml.send('value-pairs-name', vocab_key.to_s) | |
| if Item.rdf_annotation_for_attr(vocab_key).exists? | |
| xml.send('dc-terms',RDF::URI(Item.rdf_annotation_for_attr(vocab_key).first.predicate).pname.to_s) # TODO acts_as_rdfable | |
| elsif Thesis.rdf_annotation_for_attr(vocab_key).exists? | |
| xml.send('dc-terms',RDF::URI(Thesis.rdf_annotation_for_attr(vocab_key).first.predicate).pname.to_s) # TODO acts_as_rdfable | |
| else | |
| xml.send('dc-terms', 'missing') | |
| end | |
| CONTROLLED_VOCABULARIES[:era][vocab_key][:data].each_pair do |pair| | |
| xml.pair { | |
| if vocab_key == :item_type | |
| xml.send('display-value', I18n.t("controlled_vocabularies.#{:era}.item_type_with_status.#{pair[0]}", default: "controlled_vocabularies.#{:era}.item_type_with_status.#{pair[0]}")) | |
| else | |
| xml.send('display-value', I18n.t("controlled_vocabularies.#{:era}.#{vocab_key}.#{pair[0]}", default: "controlled_vocabularies.#{:era}.#{vocab_key}.#{pair[0]}")) | |
| end | |
| xml.send('stored-value', pair[1]) | |
| } | |
| end | |
| } | |
| end | |
| } | |
| } | |
| end | |
| puts builder.to_xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <input-forms> | |
| <form-value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>visibility</value-pairs-name> | |
| <dc-terms>dc:accessRights</dc-terms> | |
| <pair> | |
| <display-value>Authenticated</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/authenticated</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Draft</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/draft</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Embargo</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/embargo</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Private</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/private</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Public</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/public</stored-value> | |
| </pair> | |
| </value-pairs> | |
| </form-value-pairs> | |
| <form-value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>institution</value-pairs-name> | |
| <dc-terms>http://ontoware.org/swrc/ontology#institution</dc-terms> | |
| <pair> | |
| <display-value>University of Alberta</display-value> | |
| <stored-value>http://id.loc.gov/authorities/names/n79058482</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>St. Stephen's College</display-value> | |
| <stored-value>http://id.loc.gov/authorities/names/n2009054054</stored-value> | |
| </pair> | |
| </value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>item_type</value-pairs-name> | |
| <dc-terms>dc:type</dc-terms> | |
| <pair> | |
| <display-value>controlled_vocabularies.era.item_type_with_status.article</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/Article</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Book</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/Book</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Chapter</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/Chapter</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Image</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/Image</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Report</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/Report</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Research Material</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/researchMaterial</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Conference/Workshop Presentation</display-value> | |
| <stored-value>http://vivoweb.org/ontology/core#Presentation</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Conference/Workshop Poster</display-value> | |
| <stored-value>http://vivoweb.org/ontology/core#ConferencePoster</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Dataset</display-value> | |
| <stored-value>http://vivoweb.org/ontology/core#Dataset</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Review</display-value> | |
| <stored-value>http://vivoweb.org/ontology/core#Review</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Learning Object</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/learningObject</stored-value> | |
| </pair> | |
| </value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>language</value-pairs-name> | |
| <dc-terms>dc:language</dc-terms> | |
| <pair> | |
| <display-value>English</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/eng</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>French</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/fre</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Other language</display-value> | |
| <stored-value>http://terms.library.ualberta.ca/other</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Ukrainian</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/ukr</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>German</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/ger</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Japanese</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/jpn</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Italian</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/ita</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Russian</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/rus</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>No linguistic content</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/zxx</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Chinese</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/zho</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Spanish</display-value> | |
| <stored-value>http://id.loc.gov/vocabulary/iso639-2/spa</stored-value> | |
| </pair> | |
| </value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>license</value-pairs-name> | |
| <dc-terms>dc:license</dc-terms> | |
| <pair> | |
| <display-value>Attribution 4.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by/4.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-ShareAlike 4.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-sa/4.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NonCommercial 4.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nc/4.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NonCommercial-NoDerivatives 4.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nc-nd/4.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>CC0 1.0 Universal</display-value> | |
| <stored-value>http://creativecommons.org/publicdomain/zero/1.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NoDerivatives 4.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nd/4.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Public Domain Mark 1.0</display-value> | |
| <stored-value>http://creativecommons.org/publicdomain/mark/1.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NonCommercial-ShareAlike 4.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nc-sa/4.0/</stored-value> | |
| </pair> | |
| </value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>old_license</value-pairs-name> | |
| <dc-terms>missing</dc-terms> | |
| <pair> | |
| <display-value>Attribution 3.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by/3.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NonCommercial 3.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nc/3.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-ShareAlike 3.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-sa/3.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NonCommercial-NoDerivatives 3.0 International</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nc-nd/3.0/</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>Attribution-NonCommercial-ShareAlike 2.5 Canada</display-value> | |
| <stored-value>http://creativecommons.org/licenses/by-nc-sa/2.5/ca/</stored-value> | |
| </pair> | |
| </value-pairs> | |
| <value-pairs> | |
| <value-pairs-name>publication_status</value-pairs-name> | |
| <dc-terms>bibo:status</dc-terms> | |
| <pair> | |
| <display-value>controlled_vocabularies.era.publication_status.published</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/status#published</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>controlled_vocabularies.era.publication_status.draft</display-value> | |
| <stored-value>http://purl.org/ontology/bibo/status#draft</stored-value> | |
| </pair> | |
| <pair> | |
| <display-value>controlled_vocabularies.era.publication_status.submitted</display-value> | |
| <stored-value>http://vivoweb.org/ontology/core#submitted</stored-value> | |
| </pair> | |
| </value-pairs> | |
| </form-value-pairs> | |
| </input-forms> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment