This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Add below to settings.py | |
AUTHENTICATION_BACKENDS = ( | |
'ldapBackend.LDAPBackend', | |
'django.contrib.auth.backends.ModelBackend', | |
) | |
Requires python-ldap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample scripts for using the VIVO SPARQL Update API in PHP, Python. | |
https://wiki.duraspace.org/display/VIVO/The+SPARQL+Update+API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Check to see if a given integer is prime. | |
* | |
* Adapted from this Python implementation http://pthree.org/2007/09/05/prime-numbersin- python/ | |
* This list of the first 10,000 prime numbers is also helpful http://primes.utm.edu/lists/small/10000.txt | |
* | |
* @param int $number the number to check to see if it is prime. | |
* @return boolean true if the number is prime, false if not. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Jython script to connect to VIVO via SDB and export a model. | |
Requires Jython 2.5 or later. Download from: http://www.jython.org/downloads.html | |
Assumes the VIVO harvester is on your path. | |
- change the database connection information to point to your VIVO database. | |
- change the model name to specify the VIVO model you would like to export. | |
- change the output_file name to the location where you want to save the RDF. | |
- for larger models you will want to increase the memory available to Java. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Utility script to parse VIVO listViewConfig.xml files. | |
Requires | |
- rdflib_sparql | |
- SPARQLWrapper | |
Run as | |
$ python generate_listview.py /path/to/listViewConfig-awardOrHonor.xml | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from pprint import pprint | |
import urllib | |
from rdflib import Namespace | |
from rdfalchemy import rdfSingle | |
from rdfalchemy.rdfSubject import rdfSubject | |
from rdflib import Literal, BNode, Namespace, URIRef | |
from rdflib import RDF, RDFS, Graph, OWL |
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 5 columns, instead of 4. in line 9.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name,pages,rank,wikidata,baseball_ref | |
Babe Ruth,55,1,http://www.wikidata.org/entity/Q213812,http://www.baseball-reference.com/players/r/ruthba01.shtml | |
Ichiro Suzuki,52,2,http://www.wikidata.org/entity/Q600,http://www.baseball-reference.com/players/s/suzukic01.shtml | |
Yogi Berra,46,3,http://www.wikidata.org/entity/Q367566,http://www.baseball-reference.com/players/b/berrayo01.shtml | |
Jackie Robinson,42,4,http://www.wikidata.org/entity/Q221048,http://www.baseball-reference.com/players/r/robinja02.shtml | |
Joe DiMaggio,40,5,http://www.wikidata.org/entity/Q297142,http://www.baseball-reference.com/players/d/dimagjo01.shtml | |
Jim Thorpe,39,6,http://www.wikidata.org/entity/Q221482,http://www.baseball-reference.com/players/t/thorpji01.shtml | |
Hank Aaron,36,7,http://www.wikidata.org/entity/Q215777,http://www.baseball-reference.com/players/a/aaronha01.shtml | |
Mickey Mantle,30,8,http://www.wikidata.org/entity/Q345004,http://www.baseball-reference.com/players/m/mantlmi01.shtml | |
Alex Rodriguez,29,9,http://www.wikidata.org/entity/Q558664 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Look up batches of UTs in InCites. | |
Run as: | |
$ python incites_batch_lookup.py sample_file.csv outputfile.csv | |
""" | |
import csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Linked Data Fragments server", | |
"datasources": { | |
"local-vivo": { | |
"title": "VIVO", | |
"type": "VivoSparqlDatasource", | |
"description": "local VIVO", | |
"settings": { | |
"endpoint": "http://localhost:8080/vivo/api/sparqlQuery", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<request xmlns="http://www.isinet.com/xrpc41" src="app.id=InternalVIVODemo"> | |
<fn name="LinksAMR.retrieve"> | |
<list> | |
<!-- authentication --> | |
<map> | |
<val name="username">xxx</val> | |
<val name="password">xxx</val> | |
</map> | |
<!-- what to to return --> |