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
Hello!
First of all: this issue concerns the links branch. Please have a look at the corresponding issue #13 if you need more information.
An error is raised when I try to use linked_to objects using another class.
Some background first
I work in healthcare research. In the disorders classifications, a disorder has multiple children (to narrow the diagnosis) and multiple parents (multiple path may lead you to the same disorder). A disorder can also be found in multiple classifications (top-level disorders, you could say).
I created the models Disorder and Classification.
As we used SKOS:broader for the parents of a disorder, I created the links :broaders (= parents) and :narrowers (= children). There's also a :classifications link.
As nothing is too easy, I had to fork tripod to make it work in my environment which is Rails 4 (issue #14) and OpenRDF's Sesame (issue #15). I may have missed a part of code to patch.
Code
Here's (part of) my disorder model:
classDisorderincludeTripod::Resourcerdf_typeRDF::SKOS.Concept# NB: this will changefield# snip ...linked_to:broaders,RDF::SKOS.broader,class_name: 'Disorder',field_name: :broaders_uri,multivalued: truelinked_from:narrowers,:broaders,class_name: 'Disorder',multivalued: truelinked_to:classifications,RDF::SKOS.inScheme,class_name: 'Classification',multivalued: true# snip ...end
And here is the Classification model:
classClassificationincludeTripod::Resourcerdf_typeRDF::SKOS.ConceptSchemefield# snip...linked_from:narrowers,:broaders,class_name: 'Disorder',multivalued: true# a classification is also a top-level disorderlinked_from:all_narrowers,:classifications,class_name: 'Disorder',multivalued: true#snip...end
Now the problem
The broaders and narrowers of a disorder work great, thanks!
I can create a Classification instance so I'm sure that my model is loaded.
But as soon as I try to access the classifications of a disorder, I get this error:
undefined method `predicate' for nil:NilClass
The error occurs before I see any tripod log about loading the classifications data.
I'll comment as soon as I find my typo (still hoping it's one) or patched! Maybe classification[s] is a reserved keyword I didn't know.
Cheers,
Yannick
The text was updated successfully, but these errors were encountered:
I was missing the latest commit, I merged just before Ric did it.
My bad. Sorry for your time.
My fork is updated with the correct code.
Everything is nice and beautiful in this world now.
Hello!
First of all: this issue concerns the links branch. Please have a look at the corresponding issue #13 if you need more information.
An error is raised when I try to use linked_to objects using another class.
Some background first
I work in healthcare research. In the disorders classifications, a disorder has multiple children (to narrow the diagnosis) and multiple parents (multiple path may lead you to the same disorder). A disorder can also be found in multiple classifications (top-level disorders, you could say).
I created the models Disorder and Classification.
As we used SKOS:broader for the parents of a disorder, I created the links :broaders (= parents) and :narrowers (= children). There's also a :classifications link.
As nothing is too easy, I had to fork tripod to make it work in my environment which is Rails 4 (issue #14) and OpenRDF's Sesame (issue #15). I may have missed a part of code to patch.
Code
Here's (part of) my disorder model:
And here is the Classification model:
Now the problem
The broaders and narrowers of a disorder work great, thanks!
I can create a Classification instance so I'm sure that my model is loaded.
But as soon as I try to access the classifications of a disorder, I get this error:
The error occurs before I see any tripod log about loading the classifications data.
I'll comment as soon as I find my typo (still hoping it's one) or patched! Maybe classification[s] is a reserved keyword I didn't know.
Cheers,
Yannick
The text was updated successfully, but these errors were encountered: