samvera-labs / ldpath

Ruby parser for the LDPath language
http://marmotta.apache.org/ldpath/language.html
Other
9 stars 5 forks source link

uses passed in context AND makes network call to subject URI #3

Closed elrayle closed 5 years ago

elrayle commented 5 years ago

Descriptive summary

I would like to have the option to force ldpath to only return values from the passed in context.

Rationale

In my use case, the results are all expected to be in the passed in context. I am able to make a single network call to build the context. The context holds triples for multiple subject URIs each of which is processed in turn. Additionally, there are multiple ldpath requests made per subject. This results in a large number of network calls which is slow.

Expected behavior

When context is provided, only that context will be used for find ldpath results.

OR have an option that indicates only the context should be used.

Actual behavior

When context is provided, the context is used to find ldpath results AND a network call is made to the subject URI to get additional ldpath results.

Supporting Spec

Gist with spec demonstrating the context + network call results... https://gist.github.com/elrayle/581e0ca23a0a5a8176fcbab26b02b5d1

I wrote a test to demonstrate that results are pulled from the passed in context and from a network call. In my test, I expect the values to be from the passed in context only. It fails because it pulls results from the context and a network call to the subject uri.

I see the following statement in the log which indicates that the network call was made.

Loading "http://id.loc.gov/authorities/names/n79021164"
elrayle commented 5 years ago

Fixed by PR #7