Skip to content

Commit

Permalink
Update based on changes in Spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccrae committed Jan 5, 2024
1 parent bb9cb4f commit 5273b49
Show file tree
Hide file tree
Showing 52 changed files with 443 additions and 474 deletions.
3 changes: 0 additions & 3 deletions dmlex-v1.0/specification/examples/examples/16.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
- sense (id: colour-3)
- definition (text: a sign of a person's race)
- example (text: People of all creeds and colours.)
- sense (id: colour-4)
- definition (text: interest or excitement)
- example (text: Examples add colour to your writing.)
- relation (type: subsensing)
- member (rer: colour-1, role: super)
- member (ref: colour-2, role: sub)
Expand Down
3 changes: 2 additions & 1 deletion dmlex-v1.0/specification/examples/examples/build_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from glob import glob

N = 70
N = 74

for f in glob("source/*.xml"):
with open(f) as inf:
Expand All @@ -26,6 +26,7 @@
for f in glob("source/*.rdf"):
with open(f) as inf:
with open(f + ".xml", "w") as outf:
n = 1
outf.write("<programlisting>\n")
for line in inf.readlines():
if "PREFIX" not in line and line.strip() != "":
Expand Down
28 changes: 14 additions & 14 deletions dmlex-v1.0/specification/examples/examples/source/0.rdf.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<programlisting>
&lt;file:abandon-verb-1&gt; a dmlex:Sense;
ex:lexicon a dmlex:LexicographicResource;
dmlex:title "Example Dictionary";
dmlex:uri "http://example.com";
dmlex:langCode "en";
dmlex:entry ex:abandon-verb.
ex:abandon-verb a dmlex:Entry;
dmlex:sense ex:abandon-verb-1,
ex:abandon-verb-2;
dmlex:partOfSpeech [
dmlex:tag "verb";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:headword "abandon".
ex:abandon-verb-1 a dmlex:Sense;
dmlex:definition [ a dmlex:Definition;
dmlex:text "to suddenly leave a place or a person";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
Expand All @@ -13,19 +25,7 @@
dmlex:tag "idiom" ];
dmlex:listingOrder "2"^^xsd:unsignedInt ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
[] a dmlex:LexicographicResource;
dmlex:title "Example Dictionary";
dmlex:uri "http://example.com";
dmlex:langCode "en";
dmlex:entry &lt;file:abandon-verb&gt;.
&lt;file:abandon-verb&gt; a dmlex:Entry;
dmlex:sense &lt;file:abandon-verb-1&gt;,
&lt;file:abandon-verb-2&gt;;
dmlex:partOfSpeech [
dmlex:tag "verb";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:headword "abandon".
&lt;file:abandon-verb-2&gt; a dmlex:Sense;
ex:abandon-verb-2 a dmlex:Sense;
dmlex:listingOrder "2"^^xsd:unsignedInt;
dmlex:label [
dmlex:tag "mostly-passive";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
&lt;partOfSpeech tag="verb"/&gt;
&lt;sense id="abandon-verb-1"&gt;
&lt;definition&gt;to suddenly leave a place or a person&lt;/definition&gt;

&lt;example&gt;
&lt;text&gt;I'm sorry I abandoned you like that.&lt;/text&gt;
&lt;/example&gt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<programlisting>
&lt;file:folúsghlantóir-n&gt; a dmlex:Entry;
ex:folúsghlantóir-n a dmlex:Entry;
dmlex:headword "folúsghlantóir";
dmlex:partOfSpeech [
dmlex:listingOrder "1"^^xsd:unsignedInt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"title": "My Irish-Multilingual Dictionary",
"uri": "http://example.com",
"langCode": "ga",
"translationLanguages": ["en", "de", "cs"],
"entries": [{
"headword": "focal"
}]
"translationLanguages": ["en", "de", "cs"]
}

</programlisting>
6 changes: 2 additions & 4 deletions dmlex-v1.0/specification/examples/examples/source/10.rdf.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<programlisting>
[] a dmlex:LexicographicResource;
ex:lexicon a dmlex:LexicographicResource;
dmlex:title "My Irish-Multilingual Dictionary";
dmlex:uri "http://example.com";
dmlex:translationLanguage "cs",
"en",
"de";
dmlex:langCode "ga";
dmlex:entry [ a dmlex:Entry;
dmlex:headword "focal" ].
dmlex:langCode "ga".
</programlisting>
3 changes: 0 additions & 3 deletions dmlex-v1.0/specification/examples/examples/source/10.xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
&lt;translationLanguage langCode="en"/&gt;
&lt;translationLanguage langCode="de"/&gt;
&lt;translationLanguage langCode="cs"/&gt;
&lt;entry&gt;
&lt;headword&gt;focal&lt;/headword&gt;
&lt;/entry&gt;
&lt;/lexicographicResource&gt;

</programlisting>
10 changes: 5 additions & 5 deletions dmlex-v1.0/specification/examples/examples/source/11.rdf.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<programlisting>
&lt;file:fómhar-n-1&gt; a dmlex:Sense;
ex:fómhar-n-1 a dmlex:Sense;
dmlex:headwordTranslation [ a dmlex:HeadwordTranslation;
dmlex:listingOrder "3"^^xsd:unsignedInt;
dmlex:text "Herbst";
Expand All @@ -17,7 +17,7 @@
dmlex:listingOrder "4"^^xsd:unsignedInt;
dmlex:langCode "cs" ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
&lt;file:fómhar-n-2&gt; a dmlex:Sense;
ex:fómhar-n-2 a dmlex:Sense;
dmlex:headwordTranslation [ a dmlex:HeadwordTranslation;
dmlex:langCode "en";
dmlex:listingOrder "1"^^xsd:unsignedInt;
Expand All @@ -31,8 +31,8 @@
dmlex:langCode "de";
dmlex:listingOrder "2"^^xsd:unsignedInt ];
dmlex:listingOrder "2"^^xsd:unsignedInt.
&lt;file:fómhar-n&gt; a dmlex:Entry;
ex:fómhar-n a dmlex:Entry;
dmlex:headword "fómhar";
dmlex:sense &lt;file:fómhar-n-1&gt;,
&lt;file:fómhar-n-2&gt;.
dmlex:sense ex:fómhar-n-1,
ex:fómhar-n-2.
</programlisting>
20 changes: 8 additions & 12 deletions dmlex-v1.0/specification/examples/examples/source/12.json.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,20 @@
"relations": [{
"type": "meronymy",
"members": [{
"memberID": "glasses-1",
"role": "whole",
"obverseListingOrder": 0
"ref": "glasses-1",
"role": "whole"
}, {
"memberID": "lens-1",
"role": "part",
"obverseListingOrder": 0
"ref": "lens-1",
"role": "part"
}]
}, {
"type": "meronymy",
"members": [{
"memberID": "microscope-1",
"role": "whole",
"obverseListingOrder": 0
"ref": "microscope-1",
"role": "whole"
}, {
"memberID": "lens-1",
"role": "part",
"obverseListingOrder": 0
"ref": "lens-1",
"role": "part"
}]
}],
"relationTypes": [{
Expand Down
101 changes: 56 additions & 45 deletions dmlex-v1.0/specification/examples/examples/source/12.rdf.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,69 @@
<programlisting>
&lt;file:lens-1&gt; a dmlex:Sense;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:definition [ a dmlex:Definition;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:text "curved glass that makes things seem bigger" ].
&lt;file:microscope-1&gt; a dmlex:Sense;
dmlex:definition [ a dmlex:Definition;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:text "equipment for looking at very small things" ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
[] a dmlex:LexicographicResource;
dmlex:uri "http://example.com";
dmlex:entry &lt;file:glasses&gt;,
&lt;file:lens&gt;,
&lt;file:microscope&gt;;
dmlex:langCode "en";
ex:lexicon a dmlex:LexicographicResource;
dmlex:entry ex:microscope,
ex:lens,
ex:glasses;
dmlex:relationType [ a dmlex:RelationType;
dmlex:memberType [ a dmlex:MemberType;
dmlex:min "1"^^xsd:unsignedInt;
dmlex:type dmlex:sense;
dmlex:hint dmlex:navigate;
dmlex:max "1"^^xsd:unsignedInt;
dmlex:role "part" ],
[ a dmlex:MemberType;
dmlex:max "1"^^xsd:unsignedInt;
dmlex:type dmlex:sense;
dmlex:role "whole";
dmlex:min "1"^^xsd:unsignedInt;
dmlex:hint dmlex:navigate ];
dmlex:description "part-whole relationship";
dmlex:type "meronymy" ];
dmlex:relation [ a dmlex:Relation;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:member [ a dmlex:Member;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:ref "microscope-1";
dmlex:role "whole" ],
[ a dmlex:Member;
dmlex:role "part";
dmlex:listingOrder "2"^^xsd:unsignedInt;
dmlex:obverseListingOrder "0"^^xsd:unsignedInt;
dmlex:memberID "lens-1" ],
[ a dmlex:Member;
dmlex:role "whole";
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:memberID "glasses-1";
dmlex:obverseListingOrder "0"^^xsd:unsignedInt ];
dmlex:type "meronymy" ],
dmlex:ref "lens-1" ];
dmlex:type "meronymy";
dmlex:listingOrder "2"^^xsd:unsignedInt ],
[ a dmlex:Relation;
dmlex:listingOrder "2"^^xsd:unsignedInt;
dmlex:type "meronymy";
dmlex:member [ a dmlex:Member;
dmlex:obverseListingOrder "0"^^xsd:unsignedInt;
dmlex:memberID "microscope-1";
dmlex:role "whole";
dmlex:listingOrder "1"^^xsd:unsignedInt ],
dmlex:ref "glasses-1";
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:role "whole" ],
[ a dmlex:Member;
dmlex:memberID "lens-1";
dmlex:role "part";
dmlex:obverseListingOrder "0"^^xsd:unsignedInt;
dmlex:listingOrder "2"^^xsd:unsignedInt ];
dmlex:type "meronymy" ].
&lt;file:glasses-1&gt; a dmlex:Sense;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:listingOrder "2"^^xsd:unsignedInt;
dmlex:ref "lens-1" ];
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:langCode "en";
dmlex:uri "http://example.com".
ex:glasses a dmlex:Entry;
dmlex:headword "glasses";
dmlex:sense ex:glasses-1.
ex:glasses-1 a dmlex:Sense;
dmlex:definition [ a dmlex:Definition;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:text "an optical seeing aid" ].
&lt;file:microscope&gt; a dmlex:Entry;
dmlex:sense &lt;file:microscope-1&gt;;
dmlex:text "an optical seeing aid" ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
ex:lens a dmlex:Entry;
dmlex:sense ex:lens-1;
dmlex:headword "lens".
ex:lens-1 a dmlex:Sense;
dmlex:definition [ a dmlex:Definition;
dmlex:text "curved glass that makes things seem bigger";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
ex:microscope a dmlex:Entry;
dmlex:sense ex:microscope-1;
dmlex:headword "microscope".
&lt;file:lens&gt; a dmlex:Entry;
dmlex:headword "lens";
dmlex:sense &lt;file:lens-1&gt;.
&lt;file:glasses&gt; a dmlex:Entry;
dmlex:sense &lt;file:glasses-1&gt;;
dmlex:headword "glasses".
ex:microscope-1 a dmlex:Sense;
dmlex:definition [ a dmlex:Definition;
dmlex:text "equipment for looking at very small things";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
</programlisting>
12 changes: 4 additions & 8 deletions dmlex-v1.0/specification/examples/examples/source/12.xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@
&lt;/sense&gt;
&lt;/entry&gt;
&lt;relation type="meronymy"&gt;
&lt;member memberID="glasses-1" role="whole"
obverseListingOrder="0"/&gt;
&lt;member memberID="lens-1" role="part"
obverseListingOrder="0"/&gt;
&lt;member ref="glasses-1" role="whole"/&gt;
&lt;member ref="lens-1" role="part"/&gt;
&lt;/relation&gt;
&lt;relation type="meronymy"&gt;
&lt;member memberID="microscope-1" role="whole"
obverseListingOrder="0"/&gt;
&lt;member memberID="lens-1" role="part"
obverseListingOrder="0"/&gt;
&lt;member ref="microscope-1" role="whole"/&gt;
&lt;member ref="lens-1" role="part"/&gt;
&lt;/relation&gt;
&lt;relationType type="meronymy"&gt;
&lt;description&gt;part-whole relationship&lt;/description&gt;
Expand Down
4 changes: 2 additions & 2 deletions dmlex-v1.0/specification/examples/examples/source/13.json.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"relations": [{
"type": "antonyms",
"members": [
{"memberID": "buy-1", "obverseListingOrder": 0},
{"memberID": "sell-1", "obverseListingOrder": 0}
{"ref": "buy-1"},
{"ref": "sell-1"}
]
}],
"relationTypes": [{
Expand Down
60 changes: 33 additions & 27 deletions dmlex-v1.0/specification/examples/examples/source/13.rdf.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
<programlisting>
&lt;file:sell&gt; a dmlex:Entry;
dmlex:sense &lt;file:sell-1&gt;;
dmlex:headword "sell".
&lt;file:buy&gt; a dmlex:Entry;
dmlex:sense &lt;file:buy-1&gt;;
dmlex:headword "buy".
&lt;file:sell-1&gt; a dmlex:Sense;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:definition [ a dmlex:Definition;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:text "exchange something for money" ].
&lt;file:buy-1&gt; a dmlex:Sense;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:definition [ a dmlex:Definition;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:text "get something by paying money for it" ].
[] a dmlex:LexicographicResource;
dmlex:uri "http://example.com";
dmlex:entry &lt;file:sell&gt;,
&lt;file:buy&gt;;
dmlex:langCode "en";
dmlex:relationType [ a dmlex:RelationType;
dmlex:type "antonyms";
dmlex:memberType [ a dmlex:MemberType;
dmlex:type dmlex:sense;
dmlex:max "2"^^xsd:unsignedInt;
dmlex:min "2"^^xsd:unsignedInt;
dmlex:role "obverse";
dmlex:hint dmlex:navigate ] ];
dmlex:entry ex:buy,
ex:sell;
dmlex:relation [ a dmlex:Relation;
dmlex:type "antonyms";
dmlex:member [ a dmlex:Member;
dmlex:memberID "buy-1";
dmlex:obverseListingOrder "0"^^xsd:unsignedInt;
dmlex:listingOrder "1"^^xsd:unsignedInt ],
dmlex:ref "sell-1";
dmlex:listingOrder "2"^^xsd:unsignedInt ],
[ a dmlex:Member;
dmlex:memberID "sell-1";
dmlex:obverseListingOrder "0"^^xsd:unsignedInt;
dmlex:listingOrder "2"^^xsd:unsignedInt ];
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:type "antonyms" ];
dmlex:langCode "en".
dmlex:ref "buy-1";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:listingOrder "1"^^xsd:unsignedInt ].
ex:sell a dmlex:Entry;
dmlex:headword "sell";
dmlex:sense ex:sell-1.
ex:sell-1 a dmlex:Sense;
dmlex:definition [ a dmlex:Definition;
dmlex:text "exchange something for money";
dmlex:listingOrder "1"^^xsd:unsignedInt ];
dmlex:listingOrder "1"^^xsd:unsignedInt.
ex:buy a dmlex:Entry;
dmlex:sense ex:buy-1;
dmlex:headword "buy".
ex:buy-1 a dmlex:Sense;
dmlex:listingOrder "1"^^xsd:unsignedInt;
dmlex:definition [ a dmlex:Definition;
dmlex:text "get something by paying money for it";
dmlex:listingOrder "1"^^xsd:unsignedInt ].
</programlisting>
Loading

0 comments on commit 5273b49

Please sign in to comment.