-
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
Make RDF and XML attribute definition syntax consistent #736
Comments
This seems like a good suggestion. I'm sure it's possible to do, but I'm not sure of the work that would be required. We'd need to pull out the indexing bits from OM. Whereas you'd usually assign indexing behaviors in OM, like: set_terminology do |t|
t.root(path: "fields")
t.title(index_as: [: stored_searchable])
t.author(index_as: [: stored_searchable])
end We'd want to pass those bits from the model to the OM datastream. It also be nice we could do both so as to support both varieties. |
@awead I think @jcoyne has the new indexing work mostly done in https://github.com/projecthydra/active_fedora/tree/move_indexing_to_the_model . I've tested it manually and updated dive into Hydra accordingly. For now, I think we want to keep in the legacy option of specifying indexing from the OM datastream, but I'm proposing we deprecate that and remove it in Hydra 10. Also, take a look at 31b9843 too. These two branches together make the abstractions for RDF and XML metadata much more similar, which is a big plus in training new adopters - and maybe keeping the codebase simpler overall. |
👍 |
Move the indexing logic to the model. Fixes #736
Allow property to delegate to a datastream. Ref #736
You should now add indexing hints to has_attributes by passing a block similar to how you do it with rdf properties. e.g.: class Book < ActiveFedora::Base has_metadata 'descMetadata', type: MODSDatastream has_attributes :title, :license, datastream: 'descMetadata' do |index| index.as :stored_searchable, :facetable end end
Maybe this is just crazy extra work that no-one will use, but I find it pretty confusing that in AF9 there are totally different syntaxes to specify how you index object attributes depending on whether the object metadata is persisted as RDF or XML. It seems like you should be able to specify how you want your object indexed independently of how it's persisted.
Currently in AF9, you define an object using RDF persistence like this:
And in AF9, you would define the same attributes persisted to XML as follows:
It seems awkward to specify the indexing as part of the persistence for XML only. Further, it seems like historical cruft that RDF attributes are defined using
property
and XML attributes are defined using \has_metadata`. Would it be possible to do something more like:In this example, the XML attachment is used to specify the persistence only and the indexing is handled identically regardless of whether RDF or XML is used to persist metadata. Rather than providing a
predicate
to theproperty
you specify thedelegate_to
to identify which XML attachment the term is persisted to.The text was updated successfully, but these errors were encountered: