Skip to content

Instantly share code, notes, and snippets.

View arockwell's full-sized avatar

Alex Rockwell arockwell

View GitHub Profile
<#if loginName??>
<li>
Logged in as <strong>${loginName}</strong> (<a href="${urls.logout}">Log out</a>)
</li>
<li><a href="${urls.siteAdmin}">Site Admin</a></li>
<#else>
<li><a title="log in to manage this site" href="${urls.login}">Log in</a></li>
</#if>
<http://vitro.mannlib.cornell.edu/default/vitro-kb-2>
<http://vitro.mannlib.cornell.edu/ns/vitro/0.7#updatedToOntology>
[ <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/2002/07/owl#Thing> ;
<http://vitro.mannlib.cornell.edu/ns/vitro/0.7#fromOntologyVersion>
"0.9" ;
<http://vitro.mannlib.cornell.edu/ns/vitro/0.7#toOntologyVersion>
"1.0" ;
<http://vitro.mannlib.cornell.edu/ns/vitro/0.7#updatedOntology>
<http://vivoweb.org/ontology/core>
DROP TABLE IF EXISTS `jena_g10t1_stmt`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `jena_g10t1_stmt` (
`Subj` varchar(100) character set utf8 collate utf8_bin NOT NULL,
`Prop` varchar(100) character set utf8 collate utf8_bin NOT NULL,
`Obj` varchar(100) character set utf8 collate utf8_bin NOT NULL,
`GraphID` int(11) default NULL,
KEY `jena_g10t1_stmtXSP` (`Subj`,`Prop`),
KEY `jena_g10t1_stmtXO` (`Obj`)
mysql> select * from jena_graph;
+----+-------------------------------------------------------------------+
| ID | Name |
+----+-------------------------------------------------------------------+
| 1 | http://vitro.mannlib.cornell.edu/default/vitro-kb-2 |
| 2 | http://vitro.mannlib.cornell.edu/default/vitro-kb-inf |
| 3 | http://vitro.mannlib.cornell.edu/default/vitro-kb-userAccounts |
| 4 | NULL |
| 5 | grantIngest |
| 6 | PeopleIn |
mysql> select table_schema, table_name, table_rows from information_schema.tables where (table_schema = 'hippo' or table_schema = 'vivoDB') and table_rows > 0 order by table_rows;
+--------------+-----------------+------------+
| table_schema | table_name | table_rows |
+--------------+-----------------+------------+
| hippo | jena_long_uri | 11 |
| vivoDB | jena_long_uri | 11 |
| hippo | jena_graph | 20 |
| vivoDB | jena_graph | 20 |
| hippo | jena_g20t7_stmt | 75 |
package edu.ufl.vivo;
import java.sql.*;
public class Demo {
static Connection connection = null;
static final String dbDriver = "net.sourceforge.jtds.jdbc.Driver";
static final String dbUrl = "jdbc:jtds:sqlserver://erp-beta-odbc.ad.ufl.edu:1433/ODBCWH;domain=UFAD";
static final String dbUser = "user";
require 'rubygems'
require 'rdf/raptor'
require 'rdf/ntriples'
glid_pred = RDF::URI.new('http://vivo.ufl.edu/ontology/vivo-ufl/gatorlink')
uri_glid = { RDF::URI.new('http://vivo.ufl.edu/individual/n1639') => RDF::Literal.new('alexhr'),
RDF::URI.new('http://vivo.ufl.edu/individual/n44438') => RDF::Literal.new('drspeedo')
}
statements = []
select count(?article)
where
{
?article ufVivo:harvestedBy "PubMed-Harvester" .
?article rdf:type bibo:Document
}
@arockwell
arockwell / merge_individuals_example.rb
Created February 11, 2011 16:43
merge indviduals example
#!/usr/bin/ruby
require 'rubygems'
require 'vivo_web_api'
client = VivoWebApi::Client.new('https://vivo.ufl.edu')
client.merge_individuals('username', 'password', correct_uri, duplicate_uri)
select ?org ?label
where
{
?org rdf:type foaf:Organization .
?org rdfs:label ?label
}