Skip to content

Instantly share code, notes, and snippets.

View phochste's full-sized avatar

Patrick Hochstenbach phochste

View GitHub Profile
@phochste
phochste / gist:debdedb18d55b6d4d711d8cb9841f5ea
Last active January 5, 2020 09:08
How to extract two sub images from a larger image?
I have an image which contains two rectangular regions which contains stereotype photos. What is the best way
for a large batch of photos to extract automatically the two photos in the original source?
Wat heeft leeftijd met de vraag de maken?
@prefix my: <http://lib.ugent.be/~phochste/examples/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix as: <https://www.w3.org/ns/activitystreams#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
as:Offer
a rdfs:Class , sh:NodeShape ;
rdfs:label "Keep Offers" ;
{
"@context": [
"https://www.w3.org/ns/activitystreams",
{
"ietf": "http://www.iana.org/assignments/relation/",
"ldp": "http://www.w3.org/ns/ldp#"
}
],
"actor": {
"id": "https://orcid.org/0000-0002-1825-0097",
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"http://purl.org/coar/notify"
],
"id": "urn:uuid:94ecae35-dcfd-4182-8550-22c7164fe23f",
"type": "Announce",
"actor": {
"id": "https://generic-service.com",
"name": "Generic Service",
@prefix as: <https://www.w3.org/ns/activitystreams#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
<urn:uuid:28142b78-af0b-40bf-9e1c-d579a7135fe3>
a as:Announce ;
as:actor <https://scholexplorer.openaire.eu/#about> ;
as:context <https://biblio.ugent.be/publication/8646849> ;
as:object <urn:uuid:240c0091-b271-4e44-87f7-5598da5b24ad> ;
as:origin <https://mellonscholarlycommunication.github.io/about#us> ;
@phochste
phochste / marc_rdf_dct.fix
Created May 7, 2022 07:26
Catmandu mapping from MARC21 to RDF
# Copyright 2022 Patrick.Hochstenbach@UGent.be
# License CC BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0/
# id
move_field(_id,'_r._id')
# DC - http://www.loc.gov/marc/marc2dc.html
# {See also http://www.bl.uk/bibliographic/pdfs/mappingmarc2basicrdf.pdf for alternative}
# Language
marc_map(008/35-37,lang)
@prefix ui: <http://www.w3.org/ns/ui#>.
@prefix schema: <http://schema.org/>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix : <#>.
:this
a ui:Form;
ui:parts (
:NameField
@prefix : <urn:example:> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
:Let :string "hello world" .
(_:X _:Y) log:negativeSurface {
:Let :string _:X .
# _:X string:upperCase _:Y .
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "urn:uuid:28142b78-af0b-40bf-9e1c-d579a7135fe3",
"type": "Announce",
"actor": {
"id": "https://scholexplorer.openaire.eu/#about",
"type": "Organization",
"inbox": "https://scholexplorer.openaire.eu/inbox/",
"name": "OpenAIRE ScholeXplorer"
},