You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2018. It is now read-only.
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)?
The text was updated successfully, but these errors were encountered:
That makes a certain amount of sense. An alternate approach would be to cache the cardinality of different attributes (since most accesses will be repeats in common usage); have you considered that?
Feel free to fork or contribute patches!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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)?
The text was updated successfully, but these errors were encountered: