Files
CleverRDFlib/features/metadata_extraction.feature
CoreRasurae e828acf175
CI / lint (push) Successful in 1m32s
CI / typecheck (push) Successful in 1m38s
CI / lint (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 1m30s
CI / behave (3.11) (pull_request) Successful in 1m39s
CI / behave (3.12) (pull_request) Successful in 1m39s
CI / build (pull_request) Successful in 1m29s
CI / behave (3.13) (pull_request) Successful in 1m39s
CI / behave (3.11) (push) Successful in 1m39s
CI / behave (3.12) (push) Successful in 1m41s
CI / behave (3.13) (push) Successful in 1m37s
CI / build (push) Successful in 1m30s
feat: Initial version of CleverRDFLib
ISSUES CLOSED: #1
2025-12-19 22:26:14 +00:00

133 lines
4.8 KiB
Gherkin

Feature: Metadata Extraction
As a developer using CleverRDFLib
I want to extract metadata from ontologies
So that I can access version information and descriptive metadata
Background:
Given I have a test data directory
And I have a loaded ontology for metadata extraction
And I have a MetadataExtractor instance
Scenario: Extract ontology IRI
Given I have an ontology with an ontology IRI
When I extract the ontology IRI
Then I should receive the ontology IRI as a string
And the IRI should be a valid URI
Scenario: Extract version IRI
Given I have an ontology with a version IRI
When I extract the version IRI
Then I should receive the version IRI as a string
And the IRI should be a valid URI
Scenario: Extract version info
Given I have an ontology with version information
When I extract the version info
Then I should receive the version info as a string
And the version info should be available
Scenario: Extract prior version
Given I have an ontology with prior version information
When I extract the prior version
Then I should receive the prior version IRI as a string
And the IRI should be a valid URI
Scenario: Extract all metadata
Given I have an ontology with various metadata
When I extract all metadata
Then I should receive a dictionary of metadata
And the dictionary should contain ontology IRI
And the dictionary should contain version information when available
And the dictionary should contain descriptive metadata
Scenario: Extract metadata from ontology without version
Given I have an ontology without version information
When I extract all metadata
Then I should receive a dictionary of metadata
And the version fields should be None
And the ontology IRI should still be available
Scenario: Extract imports
Given I have an ontology with owl:imports statements
When I extract the imports
Then I should receive a list of imported ontology URIs
And each URI should be a valid ontology reference
Scenario: Extract comments
Given I have an ontology with rdfs:comment statements
When I extract the comments
Then I should receive a list of comment strings
And each comment should be descriptive text
Scenario: Extract labels
Given I have an ontology with rdfs:label statements
When I extract the labels
Then I should receive a list of label strings
And each label should be a human-readable name
Scenario: Extract metadata with non-Literal version info
Given I have an ontology with version info as URIRef
When I extract the version info
Then I should receive None for metadata
Scenario: Extract metadata with non-URIRef version IRI
Given I have an ontology with version IRI as Literal
When I extract the version IRI
Then I should receive None for metadata
Scenario: Extract metadata with non-URIRef prior version
Given I have an ontology with prior version as Literal
When I extract the prior version
Then I should receive an empty list
Scenario: Extract metadata with non-Literal title
Given I have an ontology with title as URIRef
When I extract the title
Then I should receive None for metadata
Scenario: Extract metadata with non-Literal description
Given I have an ontology with description as URIRef
When I extract the description
Then I should receive None for metadata
Scenario: Extract ontology IRI when no ontology declaration exists
Given I have an ontology without any ontology declaration
When I extract the ontology IRI
Then I should receive None for ontology IRI
Scenario: Extract creator metadata
Given I have an ontology with creator information
When I extract the creator
Then I should receive a list of creator strings
Scenario: Extract contributor metadata
Given I have an ontology with contributor information
When I extract the contributor
Then I should receive a list of contributor strings
Scenario: Extract date metadata
Given I have an ontology with date information
When I extract the date
Then I should receive the date as a string
Scenario: Extract date metadata with non-Literal
Given I have an ontology with date as URIRef
When I extract the date
Then I should receive None for metadata
Scenario: Extract rights metadata
Given I have an ontology with rights information
When I extract the rights
Then I should receive the rights as a string
Scenario: Extract rights metadata with non-Literal
Given I have an ontology with rights as URIRef
When I extract the rights
Then I should receive None for metadata
Scenario: Extract imports with non-URIRef
Given I have an ontology with imports as Literal
When I extract the imports
Then I should receive an empty list