Skip to content

Conversation

Copy link

Copilot AI commented Sep 26, 2025

This PR implements functionality to identify which verbs belong to which organizations based on the domain host in the verb ID, addressing issue requirements for better data governance and system understanding.

What's Changed

Added a new getOrganization() method to the Verb class that extracts organization information from the verb ID URI. The method intelligently maps domain hosts to organization names:

// Built-in ADL verbs
Verb.ANSWERED.getOrganization(); // "ADL (Advanced Distributed Learning)"
Verb.LOGGED_IN.getOrganization(); // "ADL (Advanced Distributed Learning)"

// Custom organization verbs  
new Verb("https://example.com/verbs/learn").getOrganization(); // "example.com"
new Verb("https://w3id.org/security/vocab/verbs/requested").getOrganization(); // "W3C"

Key Features

  • Smart ADL Recognition: Identifies ADL verbs from both adlnet.gov and w3id.org/xapi/adl/ domains
  • W3C Support: Recognizes W3C verbs under w3id.org with non-ADL paths
  • Custom Verb Support: Returns domain host for custom organization verbs
  • Robust Error Handling: Gracefully handles edge cases (null IDs, relative URIs) by returning "Unknown"

Organization Mapping Examples

Verb ID Pattern Organization
http://adlnet.gov/expapi/verbs/answered ADL (Advanced Distributed Learning)
https://w3id.org/xapi/adl/verbs/logged-in ADL (Advanced Distributed Learning)
https://w3id.org/security/vocab/verbs/requested W3C
https://example.com/verbs/custom-action example.com

Benefits

  • Data Governance: Enables clear identification of verb ownership for compliance and reporting
  • System Understanding: Helps developers understand which organizations own specific verbs
  • Business Logic: Supports organization-specific requirements and implementations
  • Zero Breaking Changes: All existing functionality preserved with backward compatibility

Testing

Added comprehensive test coverage with 7 new test cases covering all scenarios including built-in verbs, custom verbs, edge cases, and organization mapping validation. All existing tests continue to pass.

Enhanced class-level JavaDoc documentation with usage examples and organization mapping patterns for improved developer experience.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Enhancement]: Identify which verbs belong to which organisations</issue_title>
<issue_description>### What

Add functionality or documentation to identify which verbs belong to which organisations within the codebase or data model. This will clarify verb-to-organisation mappings for maintainers and users.

The domain host in the verb identifies the organisation.

Why

Understanding which verbs are associated with which organisations is important for data governance, reporting, and ensuring correct implementation of business logic. It will also help users and developers better comprehend the system structure.

Notes

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #287

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] [Enhancement]: Identify which verbs belong to which organisations [Enhancement]: Add verb organization identification functionality Sep 26, 2025
Copilot AI requested a review from thomasturrell September 26, 2025 09:56
Copilot finished work on behalf of thomasturrell September 26, 2025 09:56
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.

[Enhancement]: Identify which verbs belong to which organisations

2 participants