Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagenone
Dir["lib/ld4l/virtual_collection_rdf/vocab/*.rb"].each {|file| require file[4,file.size-3] }
module LD4L
  module VirtualCollectionRDF
    class Collection < ActiveTriples::Resource
      @id_prefix="vc"

      configure :type => RDFVocabularies::ORE.Aggregation, :base_uri => LD4L::VirtualCollectionRDF.configuration.base_uri, :repository => :default

      # extended properties for LD4L implementation
      property :title,       :predicate => RDF::DC.title
      property :description, :predicate => RDF::DC.description
      property :owner,       :predicate => RDFVocabularies::DCTERMS.creator, :class_name => LD4L::VirtualCollectionRDF::Person

      # properties from ORE.Aggregation
      property :aggregates,   :predicate => RDFVocabularies::ORE.aggregates   # multiple values
    end
  end
end
Code Block
languagenone
module RDFTypes
  class OpenAnnotationRDF < ActiveTriples::Resource
    @id_prefix="oa"
    configure :type => RDFVocabularies::OA.Annotation, :base_uri => Rails.configuration.urigenerator.base_uri, :repository => :default
    property :hasTarget,   :predicate => RDFVocabularies::OA.hasTarget    # :type => URI
    property :hasBody,     :predicate => RDFVocabularies::OA.hasBody,     :class_name => RDFTypes::OpenAnnotationBodyRDF
    property :annotatedBy, :predicate => RDFVocabularies::OA.annotatedBy, :class_name => RDFTypes::PersonRDF
    property :annotatedAt, :predicate => RDFVocabularies::OA.annotatedAt  # :type => xsd:dateTime    # the time Annotation was created
    property :motivatedBy, :predicate => RDFVocabularies::OA.motivatedBy  # comes from RDFVocabularies::OA ontology
  end
end

module RDFTypes
  class OpenAnnotationBodyRDF < ActiveTriples:Resource
    @id_prefix="oab"
    configure :base_uri => Rails.configuration.urigenerator.base_uri, :repository => :default
    property :type,    :predicate => RDF::type                   # :type => URI
    property :content, :predicate => RDFVocabularies::CNT.chars  # :type => XSD.string
    property :format,  :predicate => RDF::DC.format              # :type => XSD.string
  end
end