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
@marco-brandizi
marco-brandizi / test.xml
Last active March 16, 2017 22:19
Just a Test
<person>
<name>Alice</name>
<surname>Wonderland</surname>
</person>
public interface GraphUtils<M,N,R,P,L>
{
/**
* Defaults to errorIfMultiple = false
*/
public default Optional<N> getObject ( M graphModel, String suri, String puri ) {
return getObject ( graphModel, suri, puri, false );
}
EXPLAIN MATCH (prot:Protein) - [:is_a] -> (enz:Enzyme)
WITH prot, COLLECT ( enz ) AS enzs
UNWIND enzs AS enz
MATCH (enz) - [:ac_by|:in_by] - (comp:Comp)
WITH prot, enzs, COLLECT (comp) AS comps
UNWIND enzs AS enz1
MATCH (enz1) -[]- (tns:Transport) -[]- (comp1:Comp)
WITH prot, comps + COLLECT (comp1) AS comps2
UNWIND comps2 AS comp2
RETURN prot, comp2 LIMIT 25
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 1.
"label" "property" "count" "unique" "index" "existence" "type" "array" "sample" "leftCount" "rightCount" "left" "right" "other" "otherLabels" "elementType"
"birthPlace" "Resource" 6 false false false "RELATIONSHIP" false null 6 2112 1 352 ["Place","Resource","City"] [] "relationship"
"birthPlace" "iri" 0 false false false "STRING" false null 0 0 0 0 [] [] "relationship"
"birthPlace" "MusicGroup" 12 false false false "RELATIONSHIP" false null 12 4224 1 352 ["Place","Resource","City"] [] "relationship"
"birthPlace" "Person" 100 false false false "RELATIONSHIP" false null 100 35200 1 352 ["Place","Resource","City"] [] "relationship"
"country" "Place" 4 false false false "RELATIONSHIP" false null 4 13 1 3 ["Place","Resource","Country"] [] "relationship"
"country" "iri" 0 false false false "STRING" false null 0 0 0 0 [] [] "relationship"
"country" "AdministrativeArea" 5 false false false "RELATIONSHIP" false null 5 17 1 3 ["Place","Resource","Country"] [] "relationship"
"capital" "Place" 4 false false false "RELAT
<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