Skip to content

Support import by version IRI#162

Closed
phillord wants to merge 4 commits intodevelfrom
feature/owl-import-with-version
Closed

Support import by version IRI#162
phillord wants to merge 4 commits intodevelfrom
feature/owl-import-with-version

Conversation

@phillord
Copy link
Owner

First part aiming at addressing:

#153

Previously, imports were directly resolved from the IRI, rather than
using the version IRI.

Update ClosureOntologyParser at multiple points to support this.
Add tests for import by IRI and VIRI.
Add viri_or_iri method to OntologyID.
Clean up resolve.rs
let import_closure: Result<Vec<_>, HornedError> = import_iris
.iter()
.map(|i| {
dbg!(i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a debug statement that should be removed.

localize_iri now returns a PathBuf to stop movement backward and
forward between the return and an IRI.

resolve_iri has been simplified in code layout.

materialize code has been re-worked to be more explicit about dealing
with both IRIs and file paths.

Other code modified to adapt to these changes.
Previously, resolve_iri tried a single file name for local
resolution. We now attempt many options in a defined order.

Modify localize_iri to return a Vec with multiple options
Add localize_iri_favored to return a single option
Adapt other code to new interfaces
This improves the client interface to these functions by removing the
necessity for wrapping an IRI in Some.
@phillord
Copy link
Owner Author

phillord commented Oct 2, 2025

Updated solution which makes multiple guesses about file names that a IRI could be, and also includes a number of clarifications in code.

Comments welcome.

annodc parsing now works!

cargo run --bin horned-summary annodc.owl 
   Compiling horned-owl v1.1.0 (/home/phillord/src/rust/horned-owl/feature/owl-import-with-version)
   Compiling horned-bin v1.1.0 (/home/phillord/src/rust/horned-owl/feature/owl-import-with-version/horned-bin)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.34s
     Running `/home/phillord/src/rust/horned-owl/feature/owl-import-with-version/target/debug/horned-summary annodc.owl`
Ontology has:
	Logical Components: 541
	Annotation Components: 0
	Meta Components: 2

Detailed
	Ontology ID                              | 1    
	Doc IRI                                  | 1    
	Ontology Annotation                      | 21   
	Declare Class                            | 26   
	Declare Object Property                  | 59   
	Declare Annotation Property              | 15   
	Declare Data Property                    | 11   
	Sub-Class Of                             | 51   
	Sub Object Property Of                   | 33   
	Inverse Object Properties                | 27   
	Object Property Domain                   | 36   
	Object Property Range                    | 36   
	Sub Data Property Of                     | 6    
	Data Property Domain                     | 5    
	Data Property Range                      | 5    
	Annotation Assertion                     | 210  


Incompleted Parsed
	Simple Triples: 1
	Bnode: 0
	Sequences: 0
	Class Expressions: 0
	Object Property Expressions: 0
	Data Range: 0
	Atom: 0
	Annotations: 0

@phillord
Copy link
Owner Author

phillord commented Oct 3, 2025

Rebased onto devel outside of github

@phillord phillord closed this Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants