Importing external instances as owl file - protege

I'm loading the ontology of https://users.ugent.be/~hvhaele/stad.gent.mini.ttl and import the four instances of https://users.ugent.be/~hvhaele/nwd.owl into Protégé.
the four instances
Then, using this shacl code, I should have no violations:
#prefix owl: <http://www.w3.org/2002/07/owl#> .
#prefix dcat: <http://www.w3.org/ns/dcat#> .
#prefix dct: <http://purl.org/dc/terms/> .
#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 xsd: <http://www.w3.org/2001/XMLSchema#> .
#prefix nwd: <https://users.ugent.be/~hvhaele/nwd.owl#> .
[ rdf:type owl:Ontology ;
owl:imports <https://users.ugent.be/~hvhaele/nwd.owl>
] .
# Validation item 1: Not an opendefinition.org license type
ex:OpenLicenseShape a sh:NodeShape ;
sh:targetClass dcat:Catalog , dcat:Distribution ;
sh:property [
sh:path dct:license ;
sh:class nwd:OpenLicense ;
sh:severity sh:Warning ;
sh:message "Not an opendefinition.org license type."
] .
But instead, I get three violations, being:
https://data.stad.gent/api/v2/catalog/datasets/api-luftdateninfo-csv http://purl.org/dc/terms/license http://opendatacommons.org/licenses/odbl/
https://data.stad.gent/api/v2/catalog/datasets/api-luftdateninfo-geojson http://purl.org/dc/terms/license http://www.opendatacommons.org/licenses/odbl/1.0/
https://data.stad.gent/api/v2/catalog/datasets/api-luftdateninfo-shp http://purl.org/dc/terms/license http://opendatacommons.org/licenses/odbl/
What am I doing wrong. Any help appreciated!

Related

Get DNS suffix with nodejs

With NodeJs, the "dns" library don't use dns suffix to resolve hostname.
await dns.promises.resolve('foo.ad.toto.fr')
>>> [ '10.1.40.205' ]
await dns.promises.resolve('foo')
>>> Error: queryA ENOTFOUND foo
ipconfig /all
Configuration IP de Windows
Nom de l’hôte . . . . . . . . . . : arc-pc-y399539
Suffixe DNS principal . . . . . . : ad.toto.fr
Type de noeud. . . . . . . . . . : Hybride
Routage IP activé . . . . . . . . : Non
Proxy WINS activé . . . . . . . . : Non
Liste de recherche du suffixe DNS.: ad.toto.fr
So I need to get "DNS Suffixes list" but I don't know how...
And i can't parse return of command "ipconfig" since it must be compatible with windows and linux
I found the package "systeminformation" to get primary dns suffix, but not the "DNS Suffixes list"

Azure: create SAS manually

I'm trying to implement a Perl function for creating SAS tokens. Doing all according to documentation (https://learn.microsoft.com/en-us/rest/api/storageservices/create-service-sas) I always get error "Signature fields not well formed".
My testing resource is "https://ribdkstoragepoc.blob.core.windows.net/project-poc/foo/koteyka.jpg". Variables populated by my code:
signedpermissions = 'r'
signedexpiry = '2020-05-01T07:59:00Z'
canonicalizedresource = '/blob/ribdkstoragepoc/project-poc/foo/koteyka.jpg'
signedresource = 'b'
signedversion = '2018-03-28'
Other variables are just empty lines. I generate a string using the following pattern:
my $stringToSign =
$permissions . "\n" .
$start . "\n" .
$expiry . "\n" .
$canonicalizedResource . "\n" .
$identifier . "\n" .
$IP . "\n" .
$protocol . "\n" .
$version . "\n" .
$resource . "\n" .
$snapshotTime . "\n" .
$rscc . "\n" .
$rscd . "\n" .
$rsce . "\n" .
$rscl . "\n" .
$rsct;
The string to sign:
r
2020-05-01T07:59:00Z
/blob/ribdkstoragepoc/project-poc/foo/koteyka.jpg
2018-03-28
b
Calculationg of signature: my $sig = Digest::SHA::hmac_sha256_base64($stringToSign, $key);
At last the final URL looks like: https://ribdkstoragepoc.blob.core.windows.net/project-poc/foo/koteyka.jpg?sig=YcwWvOT2FtOZGbXQxMAoSxvA2HhRmMAUp%2B6WUY%2Bjbjg&sv=2018-03-28&se=2020-05-01T07%3A59%3A00Z&sr=b&sp=r
As I have already said that does not work. Does anyone have ideas what could be wrong?
Figured out what's wrong with your code. Basically you're using 2018-03-28 version of Storage REST API so you don't need to include $resource and $snapshotTime in your $stringToSign.
Furthermore, you will need to pad your signature with 1-4 = (Ref: https://github.com/smarx/waz-storage-perl/blob/master/WindowsAzure/Storage.pm#L42).
Based on these, here's the code:
use strict;
use warnings;
use Digest::SHA qw(hmac_sha256_base64);
use MIME::Base64;
my $permissions = 'r';
my $start = '';
my $expiry = '2020-01-31T00:00:00Z';
my $canonicalizedResource = '/blob/ribdkstoragepoc/project-poc/foo/koteyka.jpg';
my $identifier = '';
#my $resource = 'b';
my $IP = '';
my $version = '2018-03-28';
my $protocol = '';
#my $snapshotTime = '';
my $rscc = '';
my $rscd = '';
my $rsce = '';
my $rscl = '';
my $rsct = '';
my $stringToSign = $permissions . "\n" . $start . "\n" . $expiry . "\n" . $canonicalizedResource . "\n" . $identifier . "\n" . $IP . "\n" . $protocol . "\n" . $version . "\n" . $rscc . "\n" . $rscd . "\n" . $rsce . "\n" . $rscl . "\n" . $rsct;
print $stringToSign;
my $accountKey = 'your-base64-account-key';
my $sig = Digest::SHA::hmac_sha256_base64($stringToSign, decode_base64($accountKey));
$sig .= '=' x (4 - (length($sig) % 4));
print "\n---------------------\n";
print $sig;
print "\n";
Give this a try, it should work.

Building Geospatial Index when working with JENA FUSEKI

I would like to use the nearby geospatial function which is described as supported here through JENA FUSEKI - https://jena.apache.org/documentation/query/spatial-query.html
I need to build the geospatial Index for the query to work. The instructions are as follows (taken from above link):
Build the TDB dataset:
java -cp $FUSEKI_HOME/fuseki-server.jar tdb.tdbloader --tdb=assembler_file data_file
using the copy of TDB included with Fuseki. Alternatively, use one of the TDB utilities tdbloader or tdbloader2:
$JENA_HOME/bin/tdbloader --loc=directory data_file
then build the spatial index with the jena.spatialindexer:
java -cp jena-spatial.jar jena.spatialindexer --desc=assembler_file
Assuming I knew which file is the assembler file in my FUSEKI folder (I don't), I search for jena-spatial.jar in my latest jena download. Having found it is not there, I search for it and find a copy of the jar here - https://jar-download.com/?detail_search=g%3A%22org.apache.jena%22+AND+a%3A%22jena-spatial%22&search_type=av&a=jena-spatial&p=1
I try running it, but I get the error "Could not find or load main class jena.spatialindexer". I do searchers for jena.spatialindexer and I find a match (cannot post here as at link post limit).
At this point I am wondering would it be possible to make this just a little bit more complicated? You know, I obviously have all the time in the world to search through google trying to figure out these cryptic clues.
In short, if anyone out there has done this before, please could you point out where I am going wrong?
Kindest regards,
Kris.
Just in case it might help, find below my configuration
#prefix fuseki: <http://jena.apache.org/fuseki#> .
#prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
#prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
#prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
#prefix : <#> .
#prefix spatial: <http://jena.apache.org/spatial#> .
# TDB
[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
# Spatial
[] ja:loadClass "org.apache.jena.query.spatial.SpatialQuery" .
spatial:SpatialDataset rdfs:subClassOf ja:RDFDataset .
#spatial:SpatialIndexSolr rdfs:subClassOf spatial:SpatialIndex .
spatial:SpatialIndexLucene rdfs:subClassOf spatial:SpatialIndex .
## ---------------------------------------------------------------
## This URI must be fixed - it's used to assemble the spatial dataset.
:spatial_dataset rdf:type spatial:SpatialDataset ;
spatial:dataset <#tdb_dataset_readwrite> ;
##spatial:index <#indexSolr> ;
spatial:index <#indexLucene> ;
.
<#tdb_dataset_readwrite> rdf:type tdb:DatasetTDB ;
tdb:location "/myfolder" ;
## # Query timeout on this dataset (milliseconds)
## ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "1000" ] ;
## # Default graph for query is the (read-only) union of all named graphs.
tdb:unionDefaultGraph true ;
.
<#indexLucene> a spatial:SpatialIndexLucene ;
#spatial:directory <file:Lucene> ;
## spatial:directory "mem" ;
spatial:directory <file:/myfolder/spatial> ;
spatial:definition <#definition> ;
.
<#definition> a spatial:EntityDefinition ;
spatial:entityField "uri" ;
spatial:geoField "geo" ;
# custom geo predicates for 1) Latitude/Longitude Format
spatial:hasSpatialPredicatePairs (
[ spatial:latitude :latitude_1 ; spatial:longitude :longitude_1 ]
[ spatial:latitude :latitude_2 ; spatial:longitude :longitude_2 ]
) ;
# custom geo predicates for 2) Well Known Text (WKT) Literal
spatial:hasWKTPredicates (:wkt_1 :wkt_2) ;
# custom SpatialContextFactory for 2) Well Known Text (WKT) Literal
spatial:spatialContextFactory
"org.locationtech.spatial4j.context.jts.JtsSpatialContextFactory"
.
# "com.spatial4j.core.context.jts.JtsSpatialContextFactory"
<#service_tdb1> rdf:type fuseki:Service ;
rdfs:label "TDB Service" ;
fuseki:name "tdb_spatial" ;
fuseki:serviceQuery "query" ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadWriteGraphStore "data" ;
# A separate read-only graph store endpoint:
fuseki:serviceReadGraphStore "get" ;
fuseki:dataset :spatial_dataset ;
as you can see I have changed the class name to org.locationtech.spatial4j.context.jts.JtsSpatialContextFactory. Besides when running fuseki I have to include another jar file in the classpath as otherwise I have issues with
EntityDefinitionAssembler WARN Custom SpatialContextFactory lib is not ready in classpath:com/vividsolutions/jts/geom/CoordinateSequenceFactory
Then my command line looks like:
java -cp "fuseki-server.jar:lib/jts-1.13.jar" org.apache.jena.fuseki.cmd.FusekiCmd -debug
I have downloaded jts-1.13.jar from here
Besides I would like to thank to Kai for pointing me in the right direction.
Note: I still have to fully understand the fields under spatial:EntityDefinition. I will try to edit with more information.

String behind two variables in directory path laravel 5

I want a "/" behind "vandiepen" and "test.txt. Now, Laravel gives an error, because it's not a good path to the file.
The file "C:\xampp\htdocs\systeembeheer\storage/download/vandiepentest.txt" does not exist
I tried to put the "/" behind the $folder and the $id variable.
$file = storage_path(). "/download/".$folder "/" .$id;
When I do that, Laravel gives an error:
syntax error, unexpected '"/"' (T_CONSTANT_ENCAPSED_STRING)
The problem is that you missed . (concatenation operator) after $folder.
It should be:
$file = storage_path() . "/download/" . $folder. "/" . $id;
Also you can use DIRECTORY_SEPARATOR.
$file = storage_path() . DIRECTORY_SEPARATOR . "download" . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $id;

Strings with WPML and Wordpress

I have a really impossible task for me. I know how put string content in wordpress ( )
but i don't know how put in this code. I want delete call and show text string.
if (!is_page_template('splash.php')) {
echo '<!-- _________________________ Start Custom HTML _________________________ -->' .
'<div class="header_html">' . "\n" .
'<div class="header_html_outer">' . "\n" .
'<div class="header_html_inner">' . "\n";
if ($cmsms_option[CMSMS_SHORTNAME . '_header_custom_html']) {
echo stripslashes($cmsms_option[CMSMS_SHORTNAME . '_header_html']) . "\n";
}
echo '<div class="cl"></div>' .
'</div>' . "\n" .
'</div>' . "\n" .
'</div>' . "\n" .
'<!-- _________________________ Finish Custom HTML _________________________ -->';
}
i can change it with the nexxt code, but show in front : _e( "text i want translate", "comercialdelmotor");
if (!is_page_template('splash.php')) {
echo '<!-- _________________________ Start Custom HTML _________________________ -->' .
'<div class="header_html">' . "\n" .
'<div class="header_html_outer">' . "\n" .
'<div class="header_html_inner">' . "\n" . '_e( "text i want translate", "comercialdelmotor");';
echo '<div class="cl"></div>' .
'</div>' . "\n" .
'</div>' . "\n" .
'</div>' . "\n" .
'<!-- _________________________ Finish Custom HTML _________________________ -->';
}
I hope I understood your question correctly. You are correct in using _e() to echo a string. Your syntax use is wrong though. Never ever use " to enclose a translatable string, the translator does not recognise it, so your string is skipped/ignored.
The correct way is to use '. So your string should look something like this _e( 'string to be translated', 'domainname' ); Note that domainname is optional, so using _e( 'string to be translated' ); is also correct.
You can go and read more about translating your theme in this great tutorial. http://code.tutsplus.com/tutorials/translating-your-theme--wp-25014

Resources