Skip to content

Instantly share code, notes, and snippets.

View CanOfBees's full-sized avatar
😶‍🌫️

Bridger Dyson-Smith CanOfBees

😶‍🌫️
View GitHub Profile
@markpbaggett
markpbaggett / check.py
Last active March 5, 2021 19:59
Check Files in a Directory for Bad Unicode Characters
from unicodedata import category
import os
class FileSet:
def __init__(self, path):
self.path = path
self.bad_files = self.__check_files()
@staticmethod
@dizzzz
dizzzz / duplicates_in_sequence.xq
Last active March 18, 2024 17:33
xquery find duplicates in sequence
(: wolfgang :)
for $i in (1, 5, 2, 4, 5)
group by $j := $i
return
    $j || ": " || count($i)
(: adam :)
let $seq := (1, 5, 2, 4, 5)
return
    distinct-values(

GraphQL-LD

GraphQL-LD is a way to query Linked Data using GraphQL.

Instead of querying GraphQL interfaces, Linked Data interfaces are queried, such as SPARQL endpoints, TPF interfaces, Linked Data documents, ... This is done by semantifying GraphQL queries using a JSON-LD context.

Try it out from your browser: http://query.linkeddatafragments.org/

Alternatively, install GraphQL-LD or Comunica SPARQL and execute GraphQL-LD queries on your machine

@adamretter
adamretter / ant-show-deps.xqy
Created September 25, 2017 15:03
XQuery to display the dependencies tree of an Ant target
(:~
: XQuery to display the dependencies of an Ant target.
:
: There are two modes of operation:
: 1) Display all targets and immediate dependencies, specified by $project-file
: 2) Show a tree of a single targets dependencies, this happens when $target-name is set as well.
:
: External parameters:
: $project-file The initial Ant file to start parsing from (imports will be expanded)
: $target-name If specified we examine only a single target and produce a tree of all dependencies (recursively)
@xokomola
xokomola / example-table.xml
Created December 21, 2016 14:43
Create ODS Spreadsheet with XQuery and BaseX
<tables>
<table name="Sheet 1">
<thead>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
</thead>
<tbody>
@joewiz
joewiz / generate-tsv.xq
Created April 28, 2015 17:21
Construct a tab-separated value (TSV) file and save it to the file system, with XQuery and EXPath File Module
xquery version "3.0";
(: Construct a tab-separated value (TSV) file and save it to the file system.
:
: This should work in any XQuery 3.0-enabled processor that supports the EXPath File
: Module.
:
: Tested in oXygen 16.1 in the "XPath/XQuery Builder" view, using the "Saxon-EE XQuery"
: engine, with "Enable XQuery 3.0 support" option selected (in the "Saxon-HE/PE/EE"
: portion of oXygen's preferences).