Skip to content

Instantly share code, notes, and snippets.

# Composers of Italian movies, who was born in places having more than 100k inhabitants
# Usage: paste it into http://it.dbpedia.org/sparql and then hit 'Run Query'
#
PREFIX dbp-onto: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?composerName ?birthplaceName
WHERE
{
# Movies from italy and their music composers
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "http://www.your-company-site.com",
"logo": "http://www.example.com/logo.png",
"contactPoint": [{
"@type": "ContactPoint",
"telephone": "+1-401-555-1212",
"contactType": "customer service"
@marco-brandizi
marco-brandizi / swap
Last active September 22, 2018 22:06
Il citato metodo della somma funziona con i numeri, ma anche con algebre che supportano operazioni analoghe a
somma e differenza. Es, con le stringhe (scusate, non ricordo bene il C):
a = a0; b = b0 // initial values
a += b // now it's a0 + b0
b = substr ( a, 0, len ( b ) ) // i.e., b = a0 + b0 - b0 = a0
a = substr ( min ( len ( b ), len ( a ) - 1 ) ) // i.e., a = a0 + b0 - b0
Stessa roba si potrebbe fare con array e liste.
PREFIX bk: <http://www.ondex.org/bioknet/terms/>
PREFIX bkr: <http://www.ondex.org/bioknet/resources/>
PREFIX bka: <http://www.ondex.org/bioknet/terms/attributes/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX agri: <http://agrischemas.org/>
PREFIX bioschema: <http://bioschemas.org/>
MATCH (pway:Path{prefName:"chlorophyll a biosynthesis I"}) - [po:part_of] - (comp)
RETURN *
LIMIT 20
// Notice the static imports, these makes the syntax below so compact
// (and the IDE will auto-define this section)
import ondex.fluent.EntityFilter.FluentGraphWrapper
import static ondex.fluent.EntityFilter.byType;
import static ondex.fluent.EntityFilter.byDoubleAttribute;
import static ondex.fluent.ConceptFilter.byAccession;
import static ondex.fluent.Filter.byRegEx;
import static ondex.fluent.EntityComparator;
import static ondex.fluent.ConceptMapper.fromRelations;
import static ondex.fluent.RelationMapper.toConcepts;
var o = new Foo ("one");
map.put ( o, o )
...
var o1 = new Foo ( "one" )
...
var o2 = map.get ( o1 ) // fetches o if .equals()/.hashCode() tells that they're equal

Counts the data sources used in the wheat dataset. Try it [here][10].

PREFIX bk: <http://knetminer.org/data/rdf/terms/biokno/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bkg: <http://knetminer.org/data/rdf/resources/graphs/>

SELECT DISTINCT ?dataSource (COUNT (DISTINCT ?e) AS ?resources)
FROM bkg:wheat
{
package info.marcobrandizi.test.jdk11;
/*
* These deps are needed:
* org.apache.commons:commons-lang3:3.9
* com.machinezoo.noexception:noexception:1.3.2
*/
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;