Skip to content
This repository was archived by the owner on Apr 4, 2018. It is now read-only.
This repository was archived by the owner on Apr 4, 2018. It is now read-only.

Schema introspection (_isUniqueObject) should be lazy or flagged #1

@chimezie

Description

@chimezie

Currently, any attribute access will triger a call to schema introspection to determine the cardinality of the set returned. This is not efficient for large schema graphs. Ideally, either schema introspection should be a global flag set by the user, or Thing.getattr should just return a generator over RDF objects and leave it up to the user to worry about the possibility of more than one RDF term being yielded

rdflib.util has a first utility method which is very useful when you only want the first item returned by a generator. However, using it with the attribute overrides of Sparta does not avoid the (possibly prohibitive) schema introspection. So, perhaps the use of a method like first renders the value of schema introspection moot (especially when you consider the cost of doing it)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions