Skip to content

Instantly share code, notes, and snippets.

View cristianvasquez's full-sized avatar
♠️

Cristian Vasquez cristianvasquez

♠️
View GitHub Profile
@cristianvasquez
cristianvasquez / infer-properties.js
Created May 31, 2024 08:42
Walkaround Model2Owl
import { n3reasoner } from 'eyereasoner'
import { readFileSync, writeFileSync } from 'fs'
export const queryString = `
@prefix sh: <http://www.w3.org/ns/shacl#> .
{ ?shape sh:property ?property } => { ?shape sh:property ?property }.
`
const shaclFile = readFileSync('reasoning/shapes.ttl', 'utf-8')
@cristianvasquez
cristianvasquez / example-alice.html
Created February 19, 2024 10:42
Alice HTML example
<!DOCTYPE html>
<head>
<style>
body {
--border: #d1d1d1;
--metadata: #4f4f4f;
}
@cristianvasquez
cristianvasquez / main.py
Created April 28, 2021 10:04
Opl hello world example
from flask import Flask, request
from flask_cors import CORS
####################################################################################
# config
####################################################################################
PORT = 5000
HOST = '127.0.0.1'
app = Flask(__name__)
@cristianvasquez
cristianvasquez / kanban_test.dart
Created December 24, 2019 11:53
Example of a drag and drop Kanban in Flutter
import 'dart:collection';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@cristianvasquez
cristianvasquez / file_explorer.css
Created May 26, 2021 07:21
Pretty file explorer in obsidian
/* condense line spacing on file explorer title list. also avoids character-level word breaks */
.nav-file-title-content,
.search-result-file-title,
.search-result-file-match {
padding-top: 0 !important;
padding-bottom: 0 !important;
line-height: normal !important;
word-break: keep-all;
}
@cristianvasquez
cristianvasquez / 2002_Metadata_Systems_Used_on_the_Web.md
Last active September 28, 2022 00:08
Descriptive and Technical Study of Languages and Metadata Systems Used on the Web

Descriptive and Technical Study of Languages and Metadata Systems Used on the Web

Cristian Vasquez, 2002

Introduction

These days most of the web content is designed by humans to be read by themselves, forming a chaotic library from which knowledge is difficult and expensive to extract.

Distinct communities promote the use of the "Semantic Web," which adds representation to the Web, to be machine-processable. The idea is to establish channels for feasible processing, integration, and reuse of Information, betting as the extraction of knowledge of better utility to humans. The semantic Web would only be an extension of the existing Web, where the Information acquires meaning through the use of Metadata, which provides semantics to its content and enables automatic reasoning about the Information.

// https://www.npmjs.com/package/@rdfjs-elements/formats-pretty
import prefixes from '@zazuko/rdf-vocabularies/prefixes'
import { turtle } from '@rdfjs-elements/formats-pretty/serializers'
import rdf from '@rdfjs/data-model'
import { Readable } from 'readable-stream'
import getStream from 'get-stream'
// Example data
const data = [
rdf.quad(rdf.namedNode('http://ex.org/s1'), rdf.namedNode('http://schema.org/name'), rdf.literal('Alice')),
// https://www.npmjs.com/package/@rdfjs-elements/formats-pretty
import prefixes from '@zazuko/rdf-vocabularies/prefixes'
import { turtle } from '@rdfjs-elements/formats-pretty/serializers'
import rdf from 'rdf-ext'
import { Readable } from 'readable-stream'
import getStream from 'get-stream'
// Setting up the prettifier
const { schema } = prefixes
const prettifier = await turtle({
@cristianvasquez
cristianvasquez / notes.11tydata.js
Created November 15, 2021 05:39
Process notes in the garden
// This regex finds all wikilinks in a string
const wikilinkRegExp = /\[\[\s?([^\[\]\|\n\r]+)(\|[^\[\]\|\n\r]+)?\s?\]\]/g;
function caselessCompare(a, b) {
return a.toLowerCase() === b.toLowerCase();
}
var SMALL_WORDS =
/\b(?:an?d?|a[st]|because|but|by|en|for|i[fn]|neither|nor|o[fnr]|only|over|per|so|some|tha[tn]|the|to|up|upon|vs?\.?|versus|via|when|with|without|yet)\b/i;
var TOKENS = /[^\s:–—-]+|./g;
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix schema: <http://schema.org/> .
schema:Person a rdfs:Class, sh:NodeShape ;
sh:property [
sh:maxCount 1 ;
sh:minCount 1 ;