We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cbee51 commit c399760Copy full SHA for c399760
lib/src/ontology.rs
@@ -322,10 +322,15 @@ impl Ontology {
322
require_ontology_names: bool,
323
) -> Result<Self> {
324
// get the rdf:type owl:Ontology declarations
325
- let decls: Vec<SubjectRef> = graph
+ let mut decls: Vec<SubjectRef> = graph
326
.subjects_for_predicate_object(TYPE, ONTOLOGY)
327
.collect::<Vec<_>>();
328
329
+ // if decls is empty, then find all subjets of sh:declare
330
+ if decls.is_empty() {
331
+ decls.extend(graph.triples_for_predicate(DECLARE).map(|t| t.subject));
332
+ }
333
+
334
// ontology_name is the subject of the first declaration
335
let ontology_name: Subject = match decls.first() {
336
Some(decl) => match decl {
0 commit comments