Skip to content

Commit

Permalink
concept/conceptComposite -> ontologicalFacet/ontologicalType - fixes #7
Browse files Browse the repository at this point in the history
- relation names now more in line with the old DanNet naming convention
- the classes have not been renamed, they still refer to EuroWordNet concepts
  • Loading branch information
simongray committed Sep 28, 2021
1 parent 3c4f4c8 commit a39f58a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions resources/schemas/dannet-schema-2022.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
rdfs:label "Orthogonal hyponym"@en ;
owl:inverseOf :orthogonalHypernym .

:concept a owl:ObjectProperty ;
:ontologicalFacet a owl:ObjectProperty ;
rdfs:domain ontolex:LexicalConcept ;
rdfs:range :Concept ;
rdfs:comment "The EuroWordNet Concept class of the synset."@en ;
rdfs:label "EuroWordNet concept"@en .
rdfs:comment "The EuroWordNet Concept describing a facet of the synset."@en ;
rdfs:label "Ontological facet"@en .

:Concept a owl:Class ;
rdfs:label "Concept"@en ;
Expand Down Expand Up @@ -284,11 +284,11 @@
rdfs:label "Vehicle"@en ;
rdfs:comment "The Vehicle Concept from EuroWordNet."@en .

:conceptComposite a owl:ObjectProperty ;
:ontologicalType a owl:ObjectProperty ;
rdfs:domain ontolex:LexicalConcept ;
rdfs:range :ConceptComposite ;
rdfs:comment "The DanNet/EuroWordNet concept composite class of the synset, formerly known as the 'ontologicalType'."@en ;
rdfs:label "DanNet/EuroWordNet concept composite"@en .
rdfs:comment "The DanNet/EuroWordNet concept composite describing multiple facets of the synset."@en ;
rdfs:label "Ontological type"@en .

:ConceptComposite a owl:Class ;
rdfs:label "DanNet/EuroWordNet concept composite"@en ;
Expand Down
11 changes: 6 additions & 5 deletions src/main/dk/wordnet/bootstrap.clj
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@
`ontological-type` string."
[synset ontological-type]
(for [concept (str/split ontological-type #"-")]
[synset :dns/concept (keyword "dns" concept)]))
[synset :dns/ontologicalFacet (keyword "dns" concept)]))

(defn ->synset-triples
"Convert a `row` from 'synsets.csv' to triples.
The legacy `ontological-type` string is converted into concept triples along
with a conceptComposite triple which is analogous to the old composite string.
The legacy `ontological-type` string is converted into facet triples along
with an ontologicalType triple which is analogous to the old composite string.
All the resulting triples reference RDF resources rather than plain strings."
[[synset-id label gloss ontological-type :as row]]
(when (= (count row) 5)
Expand All @@ -151,7 +151,7 @@
(set/union
#{[synset :rdfs/label (get special-case->replacement label label)]
[synset :rdf/type :ontolex/LexicalConcept]
[synset :dns/conceptComposite (keyword "dns" ontological-type*)]}
[synset :dns/ontologicalType (keyword "dns" ontological-type*)]}
(when (not= definition "(ingen definition)")
#{[synset :skos/definition definition]})
(explode-ontological-type synset ontological-type*)))))
Expand Down Expand Up @@ -281,6 +281,7 @@
#_[sense :ontolex/isLexicalizedSenseOf synset]}))))

(defn unmapped?
"Are some `triples` not mapped according to GWA/Ontolex?"
[triples]
(some (comp string? second) triples))

Expand Down Expand Up @@ -310,7 +311,7 @@
;; Find concepts (or alternatively, concept composites)
(->> (read-triples (:synsets imports))
(reduce into #{})
(filter (comp #{:dns/concept} second))
(filter (comp #{:dns/ontologicalFacet} second))
(map #(nth % 2))
(into #{})
(map (comp symbol name))
Expand Down

0 comments on commit a39f58a

Please sign in to comment.