-
Notifications
You must be signed in to change notification settings - Fork 63
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
Object resource #500
Object resource #500
Conversation
ActiveFedora::Rdf::Persistence. The change allows any ActiveTriples::Resource descendant which includes the mixin to be used as the resource class for an ActiveFedora::RDFDatastream, rather than requiring an ObjectResource subclass.
# | ||
# Behavior changed around how properties are handled for the type | ||
# keyword in particular | ||
xit "should write rdf with proper subjects" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the relevant failing test. It fails with:
-<http://oregondigital.org/ns/99> <http://purl.org/dc/terms/type> "Frog" .
+<http://oregondigital.org/ns/99> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> "Frog" .
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mark it as "pending" which, with the new version 3 behavior, RSpec will interpret its failure as a success. In other words, we know this is supposed to fail, so if it fails it's meeting our expectations. When it's finally patched, it will succeed and then RSpec will raise an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we definitely need to communicate with adopters about this, I wouldn't be surprised if many people have 'type' properties with dc:type.
Is it acceptable (for the moment) that this fails so silently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@no-reply raise an error if you're using a property called type
with dc:type?
doh! just read the issue...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we definitely need to communicate with adopters about this, I wouldn't be surprised if many people have 'type' properties with dc:type.
Is it acceptable (for the moment) that this fails so silently?
We're an institution which would break if this goes in and we pull it.
It wouldn't be a problem if it informed us that we were doing something bad - instead this will start silently breaking our objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a patch on the AT side in the works: ActiveTriples/ActiveTriples#64
Once that is merged the question becomes how to handle ActiveFedora versioning. Does starting to throw errors on property definitions like :name
and :type
that once worked cause a problem?
I'm 👍 fine with this, but I defer to @jcoyne. He may also want the commits squashed. |
This seems like it works great, no notes from me. 👍 |
I absolutely plan to squash prior to merge. |
Tests pass without this line. It does not appear to be necessary.
This is as far as I’ve gotten trying to get AT 0.3 working with Fedora4. I cherry-picked the commits from PR #500 into the fedora-4 branch as a start. The secret is to apply the same changes in rdf_datastream.rb to fedora_attributes.rb.
81b72ef
to
2e981f7
Compare
This is now squashed, pins to newly minted AT 0.4.0, and throws errors if you define unwelcome properties. Several test cases are changed to reflect this. From my perspective, this seems ready to go. I defer to others on how to handle communicating this change to AF7 RDF users and how to handle versioning on this end. |
Introduces a better interface for using existing Resources to back a datastream. Removes ObjectResource and related singleton_class calls. Pins to ActiveTriples 0.4.0, which restricts property names for Resources & RdfDatastreams to those not already used by a method on the class (prevents overriding `class`, `graph`, `repository`, `name`, etc...).
2e981f7
to
960ff31
Compare
While this is great work. It introduces some breaking changes. So I wonder if we need to make this change for ActiveFedora 7. Perhaps we should just leave this PR open indefinitely unless someone needs it. Does anyone have that situation? This will be helpful for crafting a patch for AF 8 though. |
Another option is to merge this and then release ActiveFedora 8 which would target Fedora Commons 3. Then we make the fedora-4 branch be ActiveFedora 9. This would be relatively painless. |
This is as far as I’ve gotten trying to get the latest AT working with Fedora4. I cherry-picked from PR #500 as a start. The secret is to apply the same changes in rdf_datastream.rb to fedora_attributes.rb.
This is as far as I’ve gotten trying to get the latest AT working with Fedora4. I cherry-picked from PR #500 as a start. The secret is to apply the same changes in rdf_datastream.rb to fedora_attributes.rb.
@jcoyne I'm with you about the need to bump versions. (Though there may be something to be said for what I take to be @terrellt's attitude that the 'breaking changes' here are actually just AF/AT catching what was always bad behavior. Maybe the property name restrictions are a bug fix?) The downside of declining to push this to Fedora 3 users is that they are then stuck on the ActiveTriples 0.2.x branch. I don't anticipate being able to port bug fixes, etc... back to a pre-1.0 release. I think @dchandekstark may also be wanting the ObjectResource changes originating in 4f9a7a6. Maybe this reveals a need for further thought about the versioning strategy for Fedora3/Fedora4 on AF? |
|
@dchandekstark I'm speaking mostly about the fact that ActiveTriples will no longer allow you to define properties that are already method names (e.g. |
Just bumping this. Do we have an idea what the way forward is? Is this AF8? |
@no-reply I think it depends on the outcome of the email conversation on hydra-tech as to whether AF with Fedora3 should be it's own gem, or rather if AF with Fedora4 should be its own gem. |
Object resource. Merged into 8.0.0.pre1 as publicized on hydra-tech.
This pushes AT to 0.3.0, in the process, it completes the removal of ObjectResource and makes it possible to pass an existing AT::Resource class to an RdfDatastream.
Removing the singleton_class.properties stuff was key to getting running on AT 0.3.x.
There is a test reverted to pending for discussion. AT's behavior has changed slightly with respect to how it handles property names conflicting with existing methods on Resource. This makes it impossible to override
type
in the relevant test. AT should handle this better (see: ActiveTriples/ActiveTriples#44), but we should also discuss to what degree this is a backwards compatibility issue.