Skip to content

Commit

Permalink
check class to be finalized is either rdfs:Class or owl:Class
Browse files Browse the repository at this point in the history
  • Loading branch information
aamedina committed Nov 19, 2023
1 parent 4a4df94 commit 4ed7dfd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/clj/net/wikipunk/rdf.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@
(mop/finalize-inheritance :owl/NamedIndividual)
(mop/finalize-inheritance :skos/Concept)
(mop/finalize-inheritance :owl/Thing)
(mop/finalize-inheritance :owl/Class)
(finalize true (set/union (set/difference (descendants :rdfs/Class)
(descendants :rdf/Property)
(descendants :owl/NamedIndividual)
Expand All @@ -1486,14 +1487,14 @@
(finalize force?
(pmap (fn [ident]
(if-some [class (mop/find-class ident)]
(try
(when (or force? (not (mop/class-finalized? class)))
(binding [mop/*env* nil]
(mop/finalize-inheritance class)))
(catch Throwable ex
(throw (ex-info "Could not finalize inheritance for metaobject" {:ident ident} ex))))
(throw (ex-info "Could not locate metaobject" {:ident ident})))
)
(when (or (identical? (mop/type-of class) :rdfs/Class)
(identical? (mop/type-of class) :owl/Class))
(try
(when (or force? (not (mop/class-finalized? class)))
(mop/finalize-inheritance class))
(catch Throwable ex
(throw (ex-info "Could not finalize inheritance for metaobject" {:ident ident} ex)))))
(throw (ex-info "Could not locate metaobject" {:ident ident}))))
metaobjects)
mop/*env*))
([force? metaobjects env]
Expand Down

0 comments on commit 4ed7dfd

Please sign in to comment.