This file contains hidden or 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 sys | |
import time | |
import random | |
def is_prime(n): | |
if (n <= 1) : | |
return False | |
if (n <= 3) : | |
return True |
This file contains hidden or 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 | |
function getGraphs() | |
{ | |
global $options; | |
$sparql = "SELECT DISTINCT ?g WHERE {GRAPH ?g {[] a ?o}}"; | |
$r = query($sparql); | |
foreach($r AS $g) { | |
$graphs[] = $g->g->value; | |
} |
This file contains hidden or 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 os | |
def split(filehandler, delimiter=',', row_limit=10000, | |
output_name_template='output_%s.csv', output_path='.', keep_headers=True): | |
""" | |
Splits a CSV file into multiple pieces. | |
A quick bastardization of the Python CSV library. | |
Arguments: |
This file contains hidden or 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
select * | |
where{ | |
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> <http://bio2rdf.org/pdb:3MEI>. | |
?mcb <http://bio2rdf.org/narf_vocabulary:has_member> ?c. | |
?c <http://bio2rdf.org/narf_vocabulary:has_attribute> ?att. | |
?att <http://bio2rdf.org/narf_vocabulary:has_md5hash> ?val. | |
FILTER regex(?val,"445c69d2714e43b727182b7496657eb1") | |
} |
This file contains hidden or 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
select STR(?ahash) AS ?s STR(?size) as ?cycle_size COUNT(?a) AS ?profile_count COUNT(distinct ?pdb_record) AS ?pdb_count | |
from <http://bio2rdf.org/rna_cycles_pdb> | |
where{ | |
?mcb a <http://bio2rdf.org/narf_vocabulary:mcb>. | |
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?pdb_record. | |
?mcb <http://bio2rdf.org/narf_vocabulary:has_member> ?a. | |
?a a <http://bio2rdf.org/narf_vocabulary:cycle>. | |
?a <http://bio2rdf.org/narf_vocabulary:has_attribute> ?cs. | |
?cs a <http://bio2rdf.org/narf_vocabulary:cycle_size>. | |
?cs <http://bio2rdf.org/narf_vocabulary:has_value> ?size. |
This file contains hidden or 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
select distinct ?a count(?b) | |
from <http://bio2rdf.org/rna_cycles_pdb> | |
where{ | |
?a a <http://bio2rdf.org/narf_vocabulary:cycle>. | |
?fdn a <http://bio2rdf.org/narf_vocabulary:first_degree_cycle_neighbour_set>. | |
?a <http://bio2rdf.org/narf_vocabulary:has_attribute> ?fdn. | |
?fdn <http://bio2rdf.org/narf_vocabulary:has_member> ?b. | |
} |
This file contains hidden or 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
select distinct STR(?size) as ?s | |
from <http://bio2rdf.org/rna_cycles_pdb> | |
where{ | |
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>. | |
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a. | |
?a <http://bio2rdf.org/pdb_vocabulary:hasPart> ?cse. | |
?cse a <http://bio2rdf.org/pdb_vocabulary:ChemicalSubstanceExtraction>. | |
?cse <http://bio2rdf.org/pdb_vocabulary:hasProduct> ?polymer. | |
?polymer a <http://bio2rdf.org/pdb_vocabulary:Polymer>. | |
?residue <http://bio2rdf.org/pdb_vocabulary:isPartOf> ?polymer. |
This file contains hidden or 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
select count (distinct ?cyc) | |
from <http://bio2rdf.org/rna_cycles_pdb> | |
where{ | |
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>. | |
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a. | |
?a <http://bio2rdf.org/pdb_vocabulary:hasPart> ?cse. | |
?cse a <http://bio2rdf.org/pdb_vocabulary:ChemicalSubstanceExtraction>. | |
?cse <http://bio2rdf.org/pdb_vocabulary:hasProduct> ?polymer. | |
?polymer a <http://bio2rdf.org/pdb_vocabulary:Polymer>. | |
?residue <http://bio2rdf.org/pdb_vocabulary:isPartOf> ?polymer. |
This file contains hidden or 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
select count (distinct ?cyc) | |
from <http://bio2rdf.org/rna_cycles_pdb> | |
where{ | |
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>. | |
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a. | |
?mcb <http://bio2rdf.org/narf_vocabulary:has_member> ?cyc. | |
} |
This file contains hidden or 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
select ?a count (distinct ?bp) as ?c | |
from <http://bio2rdf.org/rna_cycles_pdb> | |
where{ | |
?a a <http://bio2rdf.org/pdb_vocabulary:Experiment>. | |
?mcb <http://bio2rdf.org/narf_vocabulary:derived_from> ?a. | |
?a <http://bio2rdf.org/pdb_vocabulary:hasPart> ?cse. | |
?cse a <http://bio2rdf.org/pdb_vocabulary:ChemicalSubstanceExtraction>. | |
?cse <http://bio2rdf.org/pdb_vocabulary:hasProduct> ?polymer. | |
?polymer a <http://bio2rdf.org/pdb_vocabulary:Polymer>. | |
?residue <http://bio2rdf.org/pdb_vocabulary:isPartOf> ?polymer. |
NewerOlder