Skip to content

Instantly share code, notes, and snippets.

Avatar
🧊

tamsin johnson no-reply

🧊
  • UC Santa Barbara Library
  • United States
View GitHub Profile
View gist:1dea15856445bc42f6b3
:myAdminSet ldp:contains :file1, :file2 .
:myObject ldp:contains :fileContainer ;
pcdm:hasFile :file3 .
:fileContainer ldp:contains :file3 ;
ldp:hasMembershipResource :myObject ;
ldp:membershipPredicate pcdm:hasFile .
@no-reply
no-reply / rdf_demo.rb
Last active Aug 29, 2015
A Demo of ActiveFedora::Rdf in 7.x
View rdf_demo.rb
# RdfResource is a subclass of RDF::Graph with property configuration, accessors, and some other methods
# for managing "resources" as discrete subgraphs which can be managed by a Hydra datastream model.
bnode = ActiveFedora::Rdf::Resource.new
bnode.rdf_subject
# => #<RDF::Node:0x3f967a58c1b8(_:g69915530281400)>
bnode << RDF::Statement.new(bnode.rdf_subject, RDF::DC.title, RDF::Literal('A blank node'))
bnode << RDF::Statement.new(bnode.rdf_subject, RDF::DC.subject, RDF::Literal('RDF'))
bnode.dump :ntriples
View something_rdf.rb
class SomethingDatastream < ActiveFedora::NtriplesRDFDatastream
property :contributor, predicate: RDF::URI('http://example.org/ns/contributor'), class_name: 'Contributor'
end
class Contributor < ActiveFedora::Rdf::Resource
configure type: RDF::URI('http://example.org/ns/Contributor')
property :name, predicate: RDF::FOAF.name
end
class Something < ActiveFedora::Base
@no-reply
no-reply / notes.md
Last active Aug 29, 2015
LDCX^5: Metadata Aggregation/Enhancement Notes
View notes.md

Metadata Session

Framing

Mark: DPLA harvests data in DC, MODS, MARCXML and site specific formats. This session is about that harvesting, mapping, and enhancement. What should an aggregation ingest stack look like?

@no-reply
no-reply / notes.txt
Last active Aug 29, 2015
Some Provenance Notes
View notes.txt
@chrpr:
* We need field-instance level provenance for properties in an RDF model.
* We want to manage access controls based on this.
* This would allow us to have, for example, a batch-loaded dcterms:subject that is not editable, and have it co-exist on the same record with a manually created & fully editable dcterms:subject.
* I feel there should be a way to do this with activetriples, but in reviewing the repo & the gist, I'm not sure what would be best.
* I was considering an OAC inspired design, but don't like how that spec handles structured data in an annotation body (they basically say to record a bunch of extra serialized RDF as if it's a literal as the object of the oac:body tag...)
* I know this is possible with PROV-O, but figuring out how is proving painful.
* I thought about named graphs a bit, and am concerned about the number of different combinations we'd need & the complexity of the underlying graphs.
@no-reply
no-reply / at.rb
Last active Aug 29, 2015
Desired ActiveTriples Predicate -> Property Behavior
View at.rb
class Person < ActiveTriples::Resource
configure :type => RDF::FOAF.Person, :base_uri => 'http://example.org/people#'
property :name, :predicate => RDF::FOAF.name
end
class Organization< ActiveTriples::Resource
configure :type => RDF::FOAF.Organization, :base_uri => "http://example.org/orgs#"
property :name, :predicate => RDF::FOAF.name
end
@no-reply
no-reply / HydraRDFConnect.md
Created Aug 15, 2014
RDF in Hydra Workshop
View HydraRDFConnect.md

RDF in Hydra Workshop

Tom Johnson & Karen Estlund

This workshop provides an overview of the current state of RDF on the Hydra platform. We will work through examples of modeling complex metadata and creating objects that use it. The content will highlight creative use of Hydra 7's RDF capabilities to manage controlled vocabularies and integrate with Linked Data sources. Participants should expect some technical content, but need not be developers to benefit.

@no-reply
no-reply / at-semantics.md
Last active Aug 29, 2015
Property-Predicate Semantics in ActiveTriples
View at-semantics.md

Property-Predicate Semantics in ActiveTriples

ActiveTriples is an Object-to-Graph Mapper (OGM) providing ActiveModel friendly, ORM-like functionality for managing RDF resources and graphs as Objects in Ruby.

The library defines a Resource class, instances of which represent the equivalent concept in RDF. Resource objects encapsulate an individual RDF Resource (i.e. its identifier (URI or blank node), and relevant statements) creating a corresponding Object schema and API. The Object schema is strictly non-normative with respect to the data structure and content of the associated RDF graph. That is to say, it is a design goal of ActiveTriples that any arbitrary RDF graph should be readable and safely writeable using the library and compatible with any Object schema. To achieve this goal, it is necessary to specify a clear Object-Graph semanti

@no-reply
no-reply / test.rb
Last active Aug 29, 2015
Test for ActiveTriples#38
View test.rb
before do
class DummyLicense < ActiveTriples::Resource
property :title, :predicate => RDF::DC.title
end
class DummyResource < ActiveTriples::Resource
configure :type => RDF::URI('http://example.org/SomeClass')
property :license, :predicate => RDF::DC.license, :class_name => DummyLicense
property :title, :predicate => RDF::DC.title
property :replaces, :predicate => RDF::DC.replaces
View gist:0033ba310300c311e0c3
NOTIFIED: [frontend | restart unicorn] ****************************************
<192.168.50.6> ESTABLISH CONNECTION FOR USER: tom
<192.168.50.6> REMOTE_MODULE service name=unicorn_frontend state=reloaded
<192.168.50.6> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/tjohnson/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=tom', '-o', 'ConnectTimeout=10', '192.168.50.6', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1409156132.72-28508570131040 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1409156132.72-28508570131040 && echo $HOME/.ansible/tmp/ansible-tmp-1409156132.72-28508570131040'"]
<192.168.50.6> PUT /tmp/tmp2jNjg7 TO /home/tom/.ansible/tmp/ansible-tmp-1409156132.72-28508570131040/service
<192.168.50.6> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'Contr