New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patterns as arguments to get_triples, get_quads, etc #61
Comments
How would you feel about just warning/dying if you pass a pattern object to a method expecting nodes? I think I'm hesitant to add lots of different ways the same method can be invoked. And if it died, you could change |
…nt calling with a single pattern object (#61).
Something like that (580255e). |
OK. If it was an easy method to go from a pattern to a list of nodes, it would be OK, I suppose. If it is just one way to pass arguments to The motivating case is this: https://github.com/kjetilk/AtteanX-Store-LDF/blob/feature-planning/lib/AtteanX/Store/LDF.pm#L179 |
|
Huh, |
Yeah. See the Memory store for example. |
It might be a bit misleading in cases where you could pass in the same variable in multiple positions, but it's always been like this for convenience. Allowing variables makes it easy to pass in a list of things you got from a pattern object, and allowing undef allows for better syntax when passing in values explicitly (e.g. only passing in a single subject term as |
Oh, OK! Then, we some tests for that... Looking into it. |
I suppose a |
Add variables in the count_triples test (#61).
Unless you object, I'm going to merge 580255e to at least make it obvious when these methods are called with an unexpected pattern object. |
Yeah, that is ok! |
I have an idea that I just wanted to ask about:
I just intuitively did
and it didn't work, and it seems it shouldn't now. But intuitively, shouldn't that work?
So, I was thinking about how it could be made to work without placing too much burden on implementators. What I came up with is roughly that you'd need the idiom
and similarly for
get_quads
. Then,make_search_arguments
or whatever it is called could be implemented inAttean::API::TripleOrQuadPattern
to returnundef
for variables (and blanks?).The problem is that you'd need to have those everywhere,
count_triples
, etc... Not very pretty and a lot of duplication.So, perhaps
get_triples
and friends should only take patterns as arguments, and instead allowundef
s in the constructor of patterns, and generate variables from them?The text was updated successfully, but these errors were encountered: