Skip to content

Instantly share code, notes, and snippets.

View daniel-dgi's full-sized avatar

Daniel Lamb daniel-dgi

  • Discovery Garden
  • Charlottetown, PE
View GitHub Profile
@daniel-dgi
daniel-dgi / gist:f6dae6135b27087d74de
Created October 16, 2015 16:58
Autoload for chullo
<?php
require '../vendor/autoload.php';
use Islandora\Chullo\TriplestoreClient;
$triplestore = TriplestoreClient::create('http://127.0.0.1:8080/bigdata/namespace/kb/sparql/');
$sparql = <<<EOD
PREFIX ldp: <http://www.w3.org/ns/ldp#>
@daniel-dgi
daniel-dgi / gist:97f6c9c618ba771ca819
Created October 15, 2015 14:02
ldp:isMemberOfRelation and Indirect Containers behaviour
~ $ curl -X POST "http://127.0.0.1:8080/fcrepo/rest/"
http://127.0.0.1:8080/fcrepo/rest/aa/71/6b/1f/aa716b1f-0021-4ed3-9179-79c4c99f9722
~ $ curl -X POST "http://127.0.0.1:8080/fcrepo/rest/"
http://127.0.0.1:8080/fcrepo/rest/b4/b8/05/e3/b4b805e3-4570-4d07-a862-ddccf7d87a00
indirect.ttl
============
@prefix ldp: <http://www.w3.org/ns/ldp#>
@prefix pcdm: <http://pcdm.org/models#>
@daniel-dgi
daniel-dgi / basic_image.php
Created October 14, 2015 01:53
Basic Image made with a wonka meme
$fedora = Chullo::create('http://127.0.0.1:8080/fcrepo/rest');
$pcdm = new Porkpie($fedora);
$uri = $pcdm->createObject();
echo $uri;
echo "\n";
$preservation_master_path = "/Users/danny/Desktop/memes_collection/condascending_wonka/oh_you're_an_engineer.jpg";
$thumbnail_path = "/Users/danny/Desktop/memes_collection/condascending_wonka/condascending_wonka_thumbnail.png";
$mods_path = "/Users/danny/Desktop/memes_collection/condascending_wonka/oh_you're_an_engineer.xml";
$standard = "http://www.loc.gov/mods/v3";
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<!-- component-wide configuration of fcrepo -->
<bean id="fcrepo" class="org.fcrepo.camel.FcrepoComponent">
<property name="authUsername" value="fedoraAdmin"/>
~ $ curl -X POST "http://localhost:8080/fcrepo/rest"
http://localhost:8080/fcrepo/rest/5a/cb/b1/1b/5acbb11b-af93-4e4d-9610-6ab7804ce5d1⏎ ~ $
curl -X PATCH -H "Content-Type: application/sparql-update" --data-binary "@test.sparql" "http://localhost:8080/fcrepo/rest/5a/cb/b1/1b/5acbb11b-af93-4e4d-9610-6ab7804ce5d1"
~ $ curl -H "Accept: application/ld+json" "http://localhost:8080/fcrepo/rest/5a/cb/b1/1b/5acbb11b-af93-4e4d-9610-6ab7804ce5d1"
[ {
"@id" : "http://localhost:8080/fcrepo/rest/5a/cb/b1/1b/5acbb11b-af93-4e4d-9610-6ab7804ce5d1",
"@type" : [ "http://www.w3.org/ns/ldp#RDFSource", "http://www.w3.org/ns/ldp#Container", "http://www.jcp.org/jcr/nt/1.0folder", "http://www.jcp.org/jcr/nt/1.0hierarchyNode", "http://www.jcp.org/jcr/nt/1.0base", "http://www.jcp.org/jcr/mix/1.0created", "http://fedora.info/definitions/v4/repository#Container", "http://fedora.info/definitions/v4/repository#Resource", "http://www.jcp.org/jcr/mi
~ $ curl -X POST "http://localhost:8080/fcrepo/rest"
http://localhost:8080/fcrepo/rest/f5/15/30/ca/f51530ca-bc1d-4682-ba39-063e2c0f7fc5⏎\
~ $ curl -H "Accept: application/ld+json" "http://localhost:8080/fcrepo/rest/f5/15/30/ca/f51530ca-bc1d-4682-ba39-063e2c0f7fc5"
[ {
"@id" : "http://localhost:8080/fcrepo/rest/f5/15/30/ca/f51530ca-bc1d-4682-ba39-063e2c0f7fc5",
"@type" : [ "http://www.w3.org/ns/ldp#RDFSource", "http://www.w3.org/ns/ldp#Container", "http://www.jcp.org/jcr/nt/1.0folder", "http://www.jcp.org/jcr/nt/1.0hierarchyNode", "http://www.jcp.org/jcr/nt/1.0base", "http://www.jcp.org/jcr/mix/1.0created", "http://fedora.info/definitions/v4/repository#Container", "http://fedora.info/definitions/v4/repository#Resource", "http://www.jcp.org/jcr/mix/1.0lastModified", "http://www.jcp.org/jcr/mix/1.0referenceable" ],
"http://fedora.info/definitions/v4/repository#created" : [ {
"@type" : "http://www.w3.org/2001/XMLSchema#dateTime",
"@value" : "2015-05-28T17:46:27.826Z"
=== FIRST QUERY ===
PREFIX dc: <http://purl.org/dc/terms/>
DELETE WHERE
{
<> dc:title ?o0 .
} ;
INSERT DATA {
<> dc:title "Stuff" .
PREFIX nt: <http://www.jcp.org/jcr/nt/1.0>
PREFIX pcdm: <http://pcdm.org/models#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX modsrdf: <http://www.loc.gov/mods/modsrdf/v1#>
PREFIX content: <http://purl.org/rss/1.0/modules/content/>
PREFIX sioct: <http://rdfs.org/sioc/types#>
PREFIX dc11: <http://purl.org/dc/elements/1.1/>
PREFIX islandora: <http://islandora.ca/ontology/v2/>
@daniel-dgi
daniel-dgi / gist:74c047e18ab5e0dadf43
Last active August 29, 2015 14:19
Drupal Reset Script for Islandora 7.x-2.x Testing
drush eval "field_delete_field(ISLANDORA_TN_FIELD);"
drush eval "field_delete_field(ISLANDORA_MODS_FIELD);"
drush eval "field_delete_field(ISLANDORA_BASIC_IMAGE_MEDIUM_SIZE_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_CONTRIBUTOR_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_COVERAGE_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_CREATOR_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_DATE_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_DESCRIPTION_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_FORMAT_FIELD);"
drush eval "field_delete_field(ISLANDORA_DC_IDENTIFIER_FIELD);"
@daniel-dgi
daniel-dgi / gist:c17da69e66bf47395c52
Created April 21, 2015 18:47
Starting eclim in Islandora 7.x-2.x vagrant environment
$ Xvfb :1 -screen 0 1024x768x24 &
$ DISPLAY=:1 ~/eclipse/eclimd -b