app/models/datastreams/hydra/collection_rdf_datastream.rb in hydra-collections-2.0.0 vs app/models/datastreams/hydra/collection_rdf_datastream.rb in hydra-collections-2.0.1
- old
+ new
@@ -1,73 +1,56 @@
-# Copyright © 2012 The Pennsylvania State University
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-require 'active_fedora'
-
module Hydra
class CollectionRdfDatastream < ActiveFedora::NtriplesRDFDatastream
- map_predicates do |map|
- map.part_of(:to => "isPartOf", :in => RDF::DC)
- map.contributor(:in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.creator(:in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.title(:in => RDF::DC) do |index|
- index.as :stored_searchable
- end
- map.description(:in => RDF::DC) do |index|
- index.type :text
- index.as :stored_searchable
- end
- map.publisher(:in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.date_created(:to => "created", :in => RDF::DC) do |index|
- index.as :stored_searchable
- end
- map.date_uploaded(:to => "dateSubmitted", :in => RDF::DC) do |index|
- index.type :date
- index.as :stored_sortable
- end
- map.date_modified(:to => "modified", :in => RDF::DC) do |index|
- index.type :date
- index.as :stored_sortable
- end
- map.subject(:in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.language(:in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.rights(:in => RDF::DC) do |index|
- index.as :stored_searchable
- end
- map.resource_type(:to => "type", :in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.identifier(:in => RDF::DC) do |index|
- index.as :stored_searchable
- end
- map.based_near(:in => RDF::FOAF) do |index|
- index.as :stored_searchable, :facetable
- end
- map.tag(:to => "relation", :in => RDF::DC) do |index|
- index.as :stored_searchable, :facetable
- end
- map.related_url(:to => "seeAlso", :in => RDF::RDFS)
+ property :part_of, predicate: RDF::DC.isPartOf
+ property :contributor, predicate: RDF::DC.contributor do |index|
+ index.as :stored_searchable, :facetable
end
+ property :creator, predicate: RDF::DC.creator do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :title, predicate: RDF::DC.title do |index|
+ index.as :stored_searchable
+ end
+ property :description, predicate: RDF::DC.description do |index|
+ index.type :text
+ index.as :stored_searchable
+ end
+ property :publisher, predicate: RDF::DC.publisher do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :date_created, predicate: RDF::DC.created do |index|
+ index.as :stored_searchable
+ end
+ property :date_uploaded, predicate: RDF::DC.dateSubmitted do |index|
+ index.type :date
+ index.as :stored_sortable
+ end
+ property :date_modified, predicate: RDF::DC.modified do |index|
+ index.type :date
+ index.as :stored_sortable
+ end
+ property :subject, predicate: RDF::DC.subject do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :language, predicate: RDF::DC.language do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :rights, predicate: RDF::DC.rights do |index|
+ index.as :stored_searchable
+ end
+ property :resource_type, predicate: RDF::DC.type do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :identifier, predicate: RDF::DC.identifier do |index|
+ index.as :stored_searchable
+ end
+ property :based_near, predicate: RDF::FOAF.based_near do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :tag, predicate: RDF::DC.relation do |index|
+ index.as :stored_searchable, :facetable
+ end
+ property :related_url, predicate: RDF::RDFS.seeAlso
def prefix
""
end
end