Skip to content

Instantly share code, notes, and snippets.

@prefix dash: <http://datashapes.org/dash#> .
## @prefix owl: <http://www.w3.org/2002/07/owl#> .
@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 tosh: <http://topbraid.org/tosh#> .
## @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
dash:ListNodeShape
a sh:NodeShape ;
public static void main(String...args) {
Model model = ModelFactory.createDefaultModel();
Resource subject1 = ResourceFactory.createResource("http://example/s1");
Resource subject2 = ResourceFactory.createResource("http://example/s2");
Property property = ResourceFactory.createProperty("http://example/p");
Long longValue = 6L;
model.addLiteral(subject1, property, ResourceFactory.createTypedLiteral(longValue.toString(), XSDDatatype.XSDlong));
model.addLiteral(subject2, property, longValue);
RDFWriter.source(model).lang(Lang.TTL).output(System.out);
}
@afs
afs / IRIProvider3986.java
Created August 6, 2022 15:03
IRIProvider3986 - Jena IRIProvider for iri4ld
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@afs
afs / BufferAlloc.java
Last active November 17, 2022 11:21
JavaCC Buffer location strategy
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@afs
afs / Log
Created December 18, 2021 15:17
Loading Wikidata Truthy into TDB2 : 2021-12
This file has been truncated, but you can view the full file.
09:17:14 INFO Setup:
09:17:14 INFO Database: DBx
09:17:14 INFO Data: /home/afs/Datasets/Wikidata/wikidata-20211208-truthy-BETA.nt.gz
09:17:14 INFO TMPDIR: /home/afs/tmp
09:17:14 INFO
09:17:14 INFO Load node table
09:17:15 INFO Nodes :: Build node table
09:17:15 INFO Nodes :: Database = DBx
09:17:15 INFO Nodes :: TMPDIR = /home/afs/tmp
09:17:15 INFO Nodes :: Data files = /home/afs/Datasets/Wikidata/wikidata-20211208-truthy-BETA.nt.gz
@afs
afs / 2021-11-17-warnings-jena-riot-summary.txt
Created November 26, 2021 19:22
Summary: Warning from parsing Wikidata Truthy 2021-11-17: Apache Jena "riot --check".
Summary of warnings: https://gist.github.com/afs/15719d46299bcf7346e3c314ac109040
Code/Count/Message
(sorted by frequency, with max 10 illustrative examples of each):
Code:13 834 DEFAULT_PORT_SHOULD_BE_OMITTED
http://www.andreykashechkin.com:80/
http://www.vitacura.cl:80/
http://www.comune.borgoamozzano.lucca.it:80/
http://www.allywalker.com:80/
http://www.nuerburgring.de:80/angebote/family-fun/ringwerk/attraktionen/ringracer.html
@afs
afs / 2021-11-17-warnings-jena-riot.txt
Last active November 27, 2021 15:10
Warnings from parsing Wikidata Truthy 2021-11-17: Apache Jena "riot --check".
11:55:11 WARN riot :: [line: 774038, col: 84] Lexical form '-3500000000-01-01T00:00:00Z' not valid for datatype XSD dateTime
11:55:12 WARN riot :: [line: 952846, col: 84] Not advised IRI: <http://www.andreykashechkin.com:80/> Code: 13/DEFAULT_PORT_SHOULD_BE_OMITTED in PORT: If the port is the default one for the scheme it should be omitted.
11:55:34 WARN riot :: [line: 4123888, col: 86] Not advised IRI: <cvs://anonymous@linuxlibertine.cvs.sourceforge.net:/cvsroot/linuxlibertine> Code: 12/PORT_SHOULD_NOT_BE_EMPTY in PORT: The colon introducing an empty port component should be omitted entirely, or a port number should be specified.
11:55:40 WARN riot :: [line: 4874091, col: 85] Not advised IRI: <http://www.vitacura.cl:80/> Code: 13/DEFAULT_PORT_SHOULD_BE_OMITTED in PORT: If the port is the default one for the scheme it should be omitted.
11:55:42 WARN riot :: [line: 5218362, col: 85] Not advised IRI: <http://www.comune.borgoamozzano.lucca.it:80/> Code
@afs
afs / browser.html
Created November 12, 2021 10:32
Minimal HTML page to load yasgui.
<html>
<head>
<link href="https://unpkg.com/@triply/yasgui/build/yasgui.min.css" rel="stylesheet" type="text/css" />
<script src="https://unpkg.com/@triply/yasgui/build/yasgui.min.js"></script>
</head>
<body>
<h1>Browser</h1>
<div id="yasgui"></div>
<script>
const yasgui = new Yasgui(document.getElementById("yasgui"), {
@afs
afs / 00-README.md
Last active December 5, 2020 12:05
Run jena command tools and Fuseki (inc development mode)

Scripts for running:

  • Jena command line tools
  • Fuskei Main
  • Fuseki UI

either as a specific version, or in development running out of target/classes.

(scripts have system-local file names which will need adjusting to the local environment)

Symbolic links of the form

@afs
afs / ExampleServiceAuth.java
Last active October 24, 2020 16:40
Example of calling a SPARQL server with users/password authentication
/* Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 */
package examples;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials;
import org.apache.http.auth.UsernamePasswordCredentials;