Skip to content

Instantly share code, notes, and snippets.

seconds alt x_acc y_acc z_acc x_gyro y_gyro z_gyro
0.365234 234.824 0.492922 8.9013 -1.29691 0.204672 -0.616631 -0.0850555
0.426758 235.099 6.74537 11.1195 4.54158 0.513159 0.0388269 -0.231663
0.551758 235.342 -0.926023 10.0642 -1.2012 -0.000578672 -0.182306 0.0682716
0.611328 235.649 -0.524028 9.39661 -0.684347 -0.167345 0.0486008 -0.135146
0.670898 235.902 0.684347 10.4901 -2.19422 -0.0072982 0.176272 0.0975931
0.730469 235.469 -0.827917 10.2915 -0.287139 0.0446253 0.190932 0.0139046
0.790039 235.501 -0.248854 10.0905 -1.1318 -0.266305 0.55623 0.0994257
0.922852 235.067 0.342174 9.34158 1.32323 -0.00546561 -0.851814 -0.082612
0.983398 234.94 0.0981058 9.02094 0.0789632 0.00736257 0.341816 -0.163246
@baskaufs
baskaufs / test.r
Created August 30, 2023 19:06
test R script
# Run these installation commands ONLY ONCE
install.packages("tidyverse")
install.packages("maps")
install.packages("car")
# Script starts here
library(tidyverse)
library(magrittr)
#-------------
@baskaufs
baskaufs / getty_equivalent.rq
Created August 23, 2023 01:21
Find concepts that are equivalent to Getty AAT categories
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix skosxl: <http://www.w3.org/2008/05/skos-xl#>
select distinct ?iri ?prefLabel ?otherConcept
where {
# Use bind to avoid having to enter the ID twice
bind(<http://vocab.getty.edu/aat/300047090> as ?iri)
@baskaufs
baskaufs / nom_equivalent.rq
Last active August 23, 2023 01:14
Find concepts that are equivalent to Nomenclature categories
select distinct ?iri ?prefLabel ?otherConcept ?other_label
where {
# Use bind to avoid having to enter the ID twice
bind(<https://nomenclature.info/nom/13997> as ?iri)
?iri skos:prefLabel ?prefLabel.
filter(lang(?prefLabel)="en")
@baskaufs
baskaufs / broader_edges_wd.rq
Last active August 22, 2023 21:03
finds subject and object IRIs for edges in the Wikidata classification hierarchy; need to run on Wikidata Query Service
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
select distinct ?broader_subject ?subject_label ?broader_object ?object_label
where {
# Q132397 is "pitcher"
wd:Q132397 wdt:P279* ?broader_subject.
?broader_subject wdt:P279 ?broader_object.
@baskaufs
baskaufs / broader_edges_nom.rq
Last active August 22, 2023 20:51
finds subject and object IRIs for edges in Nomenclature classification
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
select distinct ?broader_subject ?subject_label ?broader_object ?object_label
from <http://nomenclature_2022-02-02>
where {
<https://nomenclature.info/nom/12978> skos:broader* ?broader_subject.
?broader_subject skos:broader ?broader_object.
?broader_subject skos:prefLabel ?subject_label.
filter(lang(?subject_label)="en")
@baskaufs
baskaufs / broader_edges_aat.rq
Created August 22, 2023 20:51
finds subject and object IRIs for Getty AAT hierarchical classification
PREFIX gvp: <http://vocab.getty.edu/ontology#>
PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#>
select distinct ?broader_subject ?subject_label ?broader_object ?object_label
from <http://AATOut_2Terms>
from <http://AATOut_HierarchicalRels>
where {
# http://vocab.getty.edu/aat/300043022 is the IRI for "teapots"
@baskaufs
baskaufs / graphs.rq
Created August 22, 2023 18:44
Determine IRIs of all graphs in triplestore
select distinct ?graph where {
graph ?graph {?s ?o ?p.}
}
@baskaufs
baskaufs / congruent_relationship.json
Created August 1, 2023 00:11
Taxon Relationship represented in JSON-LD
{
"@context": {
"subject": {
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",
"@type": "http://rs.tdwg.org/tcs/terms/TaxonConcept"
},
"predicate": "http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",
"object": {
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#object",
"@type": "http://rs.tdwg.org/tcs/terms/TaxonConcept"
@baskaufs
baskaufs / resource_relationship_bnode.json
Last active July 31, 2023 22:33
JSON-LD representation of a dwc:ResourceRelationship with blank nodes and with IRI identifiers
{
"@context": {
"subject": "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",
"predicate": "http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",
"object": "http://www.w3.org/1999/02/22-rdf-syntax-ns#object",
"relationshipEstablishedDate": {
"@id": "http://rs.tdwg.org/dwc/terms/relationshipEstablishedDate",
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
},
"relationshipRemarks": "http://rs.tdwg.org/dwc/terms/relationshipRemarks",