Skip to content
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

Merged
merged 2 commits into from
Nov 17, 2014
Merged

Object resource #500

merged 2 commits into from
Nov 17, 2014

Conversation

no-reply
Copy link
Contributor

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.

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
Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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...

Copy link
Contributor

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.

Copy link
Contributor Author

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?

@awead
Copy link
Contributor

awead commented Oct 22, 2014

I'm 👍 fine with this, but I defer to @jcoyne. He may also want the commits squashed.

@tpendragon
Copy link
Contributor

This seems like it works great, no notes from me. 👍

@no-reply
Copy link
Contributor Author

I absolutely plan to squash prior to merge.

@awead
Copy link
Contributor

awead commented Oct 22, 2014

👏 @no-reply

no-reply referenced this pull request in ActiveTriples/ActiveTriples Oct 23, 2014
Tests pass without this line. It does not appear to be necessary.
awead added a commit that referenced this pull request Oct 23, 2014
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.
@no-reply
Copy link
Contributor Author

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...).
@jcoyne
Copy link
Member

jcoyne commented Oct 25, 2014

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.

@jcoyne
Copy link
Member

jcoyne commented Oct 25, 2014

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.

no-reply pushed a commit that referenced this pull request Oct 25, 2014
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.
no-reply pushed a commit that referenced this pull request Oct 25, 2014
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.
@no-reply
Copy link
Contributor Author

@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
Copy link
Member

@jcoyne @no-reply

  1. Yes, I would like to have the update available for fc3.
  2. If that means pushing the fc4-compatible version of AF, and as @jcoyne says, it's not a big deal, let's do that, and ...
  3. Yes, I think we need to kick around the versioning strategy of AF, perhaps on hydra-tech and/or conference call.

@dchandekstark
Copy link
Member

@jcoyne @no-reply Considering further, if we reintroduced ObjectResource (as a subclass of AT::Resource adding no behavior of its own) as the default class with a deprecation warning, would that solve the backward compat issue? Seems like it could ...

@jcoyne
Copy link
Member

jcoyne commented Oct 29, 2014

@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. type)

@no-reply
Copy link
Contributor Author

Just bumping this. Do we have an idea what the way forward is? Is this AF8?

@awead
Copy link
Contributor

awead commented Oct 31, 2014

@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.

@jcoyne jcoyne added this to the 8.0.0 milestone Nov 12, 2014
@dchandekstark dchandekstark self-assigned this Nov 12, 2014
dchandekstark added a commit that referenced this pull request Nov 17, 2014
Object resource.
Merged into 8.0.0.pre1 as publicized on hydra-tech.
@dchandekstark dchandekstark merged commit a3f8293 into samvera:master Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants