jan

  • At the example of this stackoverflow question:

    „Supposing we have the following triple in Turtle syntax:

    <http:/example.com/Paul> <http:/example.com/running> <http:/example.com/10miles> .
    

    How do I add a start and end time? For example if I want to say he started at 10 am and finished his 10miles run at 12 am. I want to use xsd:dateTime.“

    https://stackoverflow.com/questions/49726990


    Sometimes it can be hard to create good, well fitting models. In my own experience it is crucial to identify a well defined set of entities and relations to create a vocabulary from.  Some people prefer to use visual strategies to develop their models. I prefer to write models in structured text.  This has the advantage that the process of modeling directly leads into actual coding.

    Here is an example on how I would tackle the question .

    1. The modelling part (not much RDF involved)

    {
        "runs": [
            {
                "id": "runs:0000001",
                "distance": {
                    "length": 10.0,
                    "unit": "mile"
                },
                "time": {
                    "start": "2018-04-09T10:00:00",
                    "end": "2018-04-09T12:00:00"
                },
                "runner": {
                    "id": "runner:0000002",
                    "name": "Paul"
                }
            }
        ]
    }
    

    We store the json document in a file run.json. From here we can use the ‚oi‘ command line tool , to create an adhoc context.

    oi run.json -t context

    The resulting context is just a stub. But with a few additions we can easily create a context document to define id’s and types for each vocable/entity/relation.

    2. The RDF part: define a proper context for your document.

       {
        "@context": {
            "ical": "http://www.w3.org/2002/12/cal/ical#",
            "xsd": "http://www.w3.org/2001/XMLSchema#",
            "runs": {
                "@id": "info:stack/49726990/runs/",
                "@container": "@list"
            },
            "distance": {
                "@id": "info:stack/49726990/distance"
            },
            "length": {
                "@id": "info:stack/49726990/length",
                "@type": "xsd:double"
            },
            "unit": {
                "@id": "info:stack/49726990/unit"
            },
            "runner": {
                "@id": "info:stack/49726990/runner/"
            },
            "name": {
                "@id": "info:stack/49726990/name"
            },
            "time": {
                "@id": "info:stack/49726990/time"
            },
            "start": {
                "@id":"ical:dtstart",
                "@type": "xsd:dateTime"
            },
            "end": {
                "@id":"ical:dtend",
                "@type": "xsd:dateTime"
            },
            "id": "@id"
        }
    }

    3. The fun part: Throw it to an RDF converter of your choice

    This is how it looks in JSON-Playground

    Or simply use ‚oi‘:

     
    oi run.json -f run.context -t ntriples
    

    Prints:

     
    _:b0 <info:stack/49726990/runs/> _:b3 .
    _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> <info:stack/49726990/runs/0000001> .
    _:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
    <info:stack/49726990/runs/0000001> <info:stack/49726990/distance> _:b1 .
    <info:stack/49726990/runs/0000001> <info:stack/49726990/runner/> <info:stack/49726990/runner/0000002> .
    <info:stack/49726990/runs/0000001> <info:stack/49726990/time> _:b2 .
    _:b1 <info:stack/49726990/length> "1.0E1"^^<http://www.w3.org/2001/XMLSchema#double> .
    _:b1 <info:stack/49726990/unit> "mile" .
    <info:stack/49726990/runner/0000002> <info:stack/49726990/name> "Paul" .
    _:b2 <http://www.w3.org/2002/12/cal/ical#dtend> "2018-04-09T12:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    _:b2 <http://www.w3.org/2002/12/cal/ical#dtstart> "2018-04-09T10:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
    
  • https://github.com/jschnasse/oi

    wget https://dl.bintray.com/jschnasse/debian/oi_0.5.10.deb
    sudo apt install ./oi_0.5.10.deb 
  • I use this docker-based approach.

    0. Create a git repo to test this

    mkdir my-git-project
    cd my-git-project
    git init
    git commit --allow-empty -m"Initialize repo to showcase gitlab-runner locally."
    

    1. Go to your git directory

    cd my-git-project
    

    2. Create a .gitlab-ci.yml

    Example .gitlab-ci.yml

    image: alpine
    
    test:
      script:
        - echo "Hello Gitlab-Runner"
    

    3. Create a docker container with your project dir mounted

    docker run -d \
      --name gitlab-runner \
      --restart always \
      -v $PWD:$PWD \
      -v /var/run/docker.sock:/var/run/docker.sock \
      gitlab/gitlab-runner:latest
    

    4. Execute with

    docker exec -it -w $PWD gitlab-runner gitlab-runner exec docker test
    

    5. Prints

    ...
    Executing "step_script" stage of the job script
    $ echo "Hello Gitlab-Runner"
    Hello Gitlab-Runner
    Job succeeded
    ...
    

    Note: The runner will only work on the commited state of your code base. Uncommited changes will be ignored. Exception: The .gitlab-ci.yml itself must not be commited to be taken into account.

  • _:b0 a <http://schema.org/Book> ;
        <http://schema.org/name> "Semantic Web Primer (First Edition)" ;
        <http://schema.org/offers> _:b1 ;
        <http://schema.org/publisher> "Linked Data Tools" .
    
    _:b1 a <http://schema.org/Offer> ;
        <http://schema.org/price> "2.95" ;
        <http://schema.org/priceCurrency> "USD" .

    Based on this stack overflow answer I created a tool named **oi** that provides some capabilities to convert rdf to json via command line. If no frame is provided via cli, the tool aims to generate @context entries for most situations.

    
    oi -i turtle -t json books.ttl |jq '.["@graph"][0]'
    

    prints

    
    {
      "@id" : "_:b0",
      "@type" : "http://schema.org/Book",
      "name" : "Semantic Web Primer (First Edition)",
      "offers" : {
        "@id" : "_:b1",
        "@type" : "http://schema.org/Offer",
        "price" : "2.95",
        "priceCurrency" : "USD"
      },
      "publisher" : "Linked Data Tools"
    }
    

    The tool attempts to create various output formats. The result is not meant to be 100% correct for each and every case. The overall idea is to provide adhoc conversions just as one step in a conversion pipeline.

    The tool is available as .deb package via it’s github page at: https://github.com/jschnasse/oi.

  • „Geimpfte Menschen wären nicht besser gestellt,[…].  Sie wären normal gestellt. Grundrechte sind kein Privileg.[…]Ungleiches ungleich zu behandeln, ist eine Grundfeste des Rechtsstaates.“

    Gefunden in taz, 20.01.2021 S. 06. briefe.

  • Drüben hinter’m Dorfe steht ein Leiermann,

    und mit starren Fingern dreht er was er kann.

     

    Baarfuss auf dem Eise wankt er hin und her,

    und sein kleiner Teller bleibt ihm immer leer,

    und sein kleiner Teller bleibt ihm immer leer,

     

    Keiner mag ihn hören, keiner sieht ihn an,

    und die Hunde knurren um den alten Mann.

    Und er lässt es gehen alles wie es will,

    dreht  und seine Leier steht ihm nimmer still.

     

    Wunderlicher Alter, soll ich mit dir gehn?

    Willst zu meinen Liedern deine Leier drehn?

     

    (Wilhelm Müller)

  • https://ws-dl.blogspot.com/2021/01/2021-01-09-embedded-tweets-from.html

  • https://laconicml.com/computer-science-curriculum-youtube-videos/