Skip to content

Instantly share code, notes, and snippets.

"""
Mint random number based IRIs.
"""
BU = Namespace('http://vivo.brown.edu/individual/')
def get_next_uri(self, prefix='n', number=1, used_uris=[], max=99999):
"""
Mint new URIs in the VIVO pattern (e.g. n1234).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lawlesst
lawlesst / mod_cache.conf
Last active August 29, 2015 13:55
mod_cache.conf config for VIVO caching on Redhat
#
#The default expire needs to be 0 in a self-editing environment so that E-Tags can be reverified.
#Requests to cached URLs that haven't expired will never reach the VIVO web application.
#
<IfModule mod_cache.c>
CacheRoot /var/cache/apache2
CacheEnable disk /display
CacheEnable disk /individual
CacheIgnoreNoLastMod On
@lawlesst
lawlesst / wos.php
Created January 23, 2014 19:51 — forked from domoritz/wos.php
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(

Google / Open Refine Reconciliation

Latest release is Google Refine 2.5. OpenRefine beta candidate available and moving forward the project is independent of Google.

Documentation and downloads available from the Open Refine website.

A useful tool in the ongoing work to move from strings to things.

Overview

>OpenRefine (ex-Google Refine) is a powerful tool for working with messy data, cleaning it, transforming it from one format into another, extending it with web services, and linking it to databases like Freebase.

@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix : <#> .
# Declaration additional assembler items.
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
import rdflib
raw = """
<rdf:RDF
xmlns:vitro-public="http://vitro.mannlib.cornell.edu/ns/vitro/public#"
xmlns:c4o="http://purl.org/spar/c4o/"
xmlns:ero="http://purl.obolibrary.org/obo/"
xmlns:pvs="http://vivoweb.org/ontology/provenance-support#"
xmlns:owl2="http://www.w3.org/2006/12/owl2-xml#"
xmlns:scirr="http://vivoweb.org/ontology/scientific-research-resource#"
@lawlesst
lawlesst / VIVO SPARQL Update API
Last active August 30, 2018 20:05
Example of using SPARQLWrapper to update data in VIVO .
Sample scripts for using the VIVO SPARQL Update API in PHP, Python.
https://wiki.duraspace.org/display/VIVO/The+SPARQL+Update+API
from vivo_utils import sparql
sparql = sparql.VIVOSparql()
sparql.login()
query = """
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>