Skip to content

Properties with the same name but different namespace got overwritten #3

Description

@LesterLyu

Let's say we have a compass:hasName and org:hasName. If the compass ontology is loaded after the compass ontology, the property has the same name will be overwritten and you may use an unexpected property from other ontology/namespace.
Internally owlready2 uses a dictionary to cache the properties and the key is the short name without namespace, i.e. hasName.

Example

organization = org.Organization()
organization.hasName = 'name'

The hasName could be several properties in several ontologies. It will be chosen depending on the order of loading.

Temporary solution

Manually choose the property from the org ontology

organization = org.Organization()
org.hasName[organization] = ['name']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions