├── .gitignore ├── LICENSE ├── README.md ├── demo ├── city-graph │ ├── admin │ │ ├── clear-ontologies.sh │ │ └── model │ │ │ ├── add-classes.sh │ │ │ └── add-imports.sh │ ├── create-charts.sh │ ├── create-containers.sh │ ├── files │ │ ├── copenhagen │ │ │ ├── bicycle-parkings.csv │ │ │ ├── charging-stations.csv │ │ │ ├── libraries.csv │ │ │ ├── parking-facilities.csv │ │ │ ├── places.csv │ │ │ ├── playgrounds.csv │ │ │ ├── public-toilets.csv │ │ │ ├── schools.csv │ │ │ └── sports-centers.csv │ │ ├── postal-areas.csv │ │ └── vilnius │ │ │ ├── Mokiniai.csv │ │ │ └── Mokyklu_sarasas.csv │ ├── import-csv.sh │ ├── imports.csv │ ├── install.sh │ ├── queries │ │ ├── charts │ │ │ └── parking-facilities-by-spaces.rq │ │ └── imports │ │ │ ├── copenhagen │ │ │ ├── bicycle-parkings.rq │ │ │ ├── charging-stations.rq │ │ │ ├── libraries.rq │ │ │ ├── parking-facilities.rq │ │ │ ├── places.rq │ │ │ ├── playgrounds.rq │ │ │ ├── public-toilets.rq │ │ │ ├── schools.rq │ │ │ └── sports-centers.rq │ │ │ └── postal-areas.rq │ ├── root.ttl │ ├── screenshot.png │ └── update-documents.sh ├── life-sciences │ ├── create-charts.sh │ ├── create-containers.sh │ ├── create-services.sh │ ├── install.sh │ ├── queries │ │ ├── chembl │ │ │ ├── molecule-logp.rq │ │ │ └── select-molecules.rq │ │ └── uniprot │ │ │ ├── select-genes.rq │ │ │ ├── select-protein-count-by-organism.rq │ │ │ └── select-proteins.rq │ ├── root.ttl │ └── screenshot.png ├── northwind-traders │ ├── Makefile │ ├── admin │ │ ├── clear-ontologies.sh │ │ └── model │ │ │ ├── add-imports.sh │ │ │ ├── import-ontologies.sh │ │ │ └── northwind-traders.ttl │ ├── create-charts.sh │ ├── create-containers.sh │ ├── csv2rdf.sh │ ├── files │ │ ├── categories.csv │ │ ├── customers.csv │ │ ├── employee_territories.csv │ │ ├── employees.csv │ │ ├── images │ │ │ ├── categories │ │ │ │ ├── beverages.gif │ │ │ │ ├── cereals.gif │ │ │ │ ├── condiments.gif │ │ │ │ ├── confections.gif │ │ │ │ ├── diary.gif │ │ │ │ ├── meat.gif │ │ │ │ ├── produce.gif │ │ │ │ └── seafood.gif │ │ │ └── employees │ │ │ │ ├── andrew.jpg │ │ │ │ ├── anne.jpg │ │ │ │ ├── janet.jpg │ │ │ │ ├── laura.jpg │ │ │ │ ├── margaret.jpg │ │ │ │ ├── michael.jpg │ │ │ │ ├── nancy.jpg │ │ │ │ ├── robert.jpg │ │ │ │ └── steven.jpg │ │ ├── order_details.csv │ │ ├── orders.csv │ │ ├── products.csv │ │ ├── regions.csv │ │ ├── shippers.csv │ │ ├── suppliers.csv │ │ └── territories.csv │ ├── import-csv.sh │ ├── imports.csv │ ├── install.sh │ ├── queries │ │ ├── charts │ │ │ ├── select-products-by-sales.rq │ │ │ └── select-sales-by-regions-by-year.rq │ │ ├── imports │ │ │ ├── categories.rq │ │ │ ├── customers.rq │ │ │ ├── employee_territories.rq │ │ │ ├── employees.rq │ │ │ ├── order_details.rq │ │ │ ├── orders.rq │ │ │ ├── products.rq │ │ │ ├── regions.rq │ │ │ ├── shippers.rq │ │ │ ├── suppliers.rq │ │ │ └── territories.rq │ │ ├── select-categories.rq │ │ ├── select-customers.rq │ │ ├── select-employees.rq │ │ ├── select-orders.rq │ │ ├── select-products.rq │ │ ├── select-regions.rq │ │ ├── select-shippers.rq │ │ ├── select-suppliers.rq │ │ └── select-territories.rq │ ├── root.ttl │ ├── screenshot.gif │ ├── update-documents.sh │ └── upload-file.sh └── skos │ ├── admin │ ├── acl │ │ └── create-authorizations.sh │ ├── clear-ontologies.sh │ ├── model │ │ ├── add-constraints.sh │ │ └── import-ontologies.sh │ └── sitemap │ │ └── queries │ │ └── describe-concept.rq │ ├── create-containers.sh │ ├── files │ ├── bootstrap.min.css │ ├── skos.xsl │ ├── unesco-thesaurus.part1.ttl │ └── unesco-thesaurus.part2.ttl │ ├── import-rdf.sh │ ├── install.sh │ ├── queries │ ├── select-concept-schemes.rq │ ├── select-concepts.rq │ └── skos-import.rq │ ├── root.ttl │ ├── screenshot.png │ ├── update-documents.sh │ └── upload-file.sh └── linkeddatahub └── docs ├── Makefile ├── about.ttl ├── decorate-html.xsl ├── docs.trix ├── files.xml ├── files ├── images │ ├── action.png │ ├── browse-data.png │ ├── change-layout-augment.png │ ├── change-layout-default.png │ ├── change-layout-suppress.png │ ├── contexts.svg │ ├── create context.png │ ├── create edit.png │ ├── layout.png │ ├── navigation bar.png │ ├── ontologies.svg │ ├── reference │ │ └── data-management │ │ │ └── resources │ │ │ ├── chart-block.png │ │ │ ├── query-block.png │ │ │ └── view-block.png │ ├── request-access1.png │ ├── request-access2.png │ ├── search.png │ ├── signup.png │ └── sparql endpoint.jpg └── videos │ ├── AddData.webm │ ├── Create.webm │ ├── CreateContextDataspace.webm │ ├── Delete.webm │ ├── DocTree.gif │ ├── Download.webm │ ├── Edit.webm │ ├── ParallaxNav.gif │ ├── RequestAccess.mov │ ├── RequestAccess.webm │ ├── Upload.webm │ └── View.webm ├── get-started.ttl ├── get-started ├── get-an-account.ttl ├── request-access.ttl └── setup.ttl ├── install.log ├── install.sh ├── reference.ttl ├── reference ├── administration.ttl ├── administration │ ├── acl.ttl │ └── ontologies.ttl ├── command-line-interface.ttl ├── configuration.ttl ├── data-model.ttl ├── data-model │ ├── blocks.ttl │ ├── blocks │ │ ├── objects.ttl │ │ └── xhtml.ttl │ ├── documents.ttl │ ├── documents │ │ ├── containers.ttl │ │ └── items.ttl │ ├── resources.ttl │ └── resources │ │ ├── charts.ttl │ │ ├── queries.ttl │ │ └── views.ttl ├── dataset.ttl ├── dataspace.ttl ├── http-api.ttl ├── imports.ttl ├── imports │ ├── csv.ttl │ └── rdf.ttl ├── stylesheets.ttl └── user-interface.ttl ├── sha1map-to-xml.sh ├── test.xml ├── trix-to-html.xsl ├── ttl-to-html.sh ├── update-document.sh ├── update-folder.sh ├── upload-file.sh ├── user-guide.ttl ├── user-guide ├── add-data.ttl ├── browse-data.ttl ├── build-apps.ttl ├── change-layout.ttl ├── change-model.ttl ├── change-system-base-uri.ttl ├── create-data.ttl ├── create-data │ ├── create-content.ttl │ ├── create-documents.ttl │ └── create-resources.ttl ├── import-data.ttl ├── import-data │ ├── import-csv-data.ttl │ └── import-rdf-data.ttl ├── manage-dataspaces.ttl ├── navigate-data.ttl ├── query-data.ttl ├── search-data.ttl └── upload-file.ttl └── validate-documents.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /linkeddatahub/docs/html 2 | linkeddatahub/.DS_Store 3 | .DS_Store 4 | linkeddatahub/docs/docs.trix 5 | linkeddatahub/docs/docs.trix 6 | -------------------------------------------------------------------------------- /demo/city-graph/admin/clear-ontologies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file="$(realpath "$2")" 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT/admin" 23 | 24 | ./clear-ontology.sh \ 25 | -f "$cert_pem_file" \ 26 | -p "$cert_password" \ 27 | -b "${base}admin/" \ 28 | --proxy "$proxy" \ 29 | --ontology "${base}ns#" 30 | 31 | popd -------------------------------------------------------------------------------- /demo/city-graph/admin/model/add-classes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/demo/city-graph/ ../../../../../certs/martynas.stage.localhost.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT/admin/model" 23 | 24 | ./add-class.sh \ 25 | -b "${base}admin/" \ 26 | -f "$cert_pem_file" \ 27 | -p "$cert_password" \ 28 | --proxy "$proxy" \ 29 | --uri "${base}ns#BicycleParking" \ 30 | --label "Bicycle parking" \ 31 | --slug bicycle-parking \ 32 | --sub-class-of "https://schema.org/CivicStructure" \ 33 | "${base}admin/ontologies/namespace/" 34 | 35 | ./add-class.sh \ 36 | -b "${base}admin/" \ 37 | -f "$cert_pem_file" \ 38 | -p "$cert_password" \ 39 | --proxy "$proxy" \ 40 | --uri "${base}ns#ChargingStation" \ 41 | --label "Charging station" \ 42 | --slug charging-station \ 43 | --sub-class-of "https://schema.org/CivicStructure" \ 44 | "${base}admin/ontologies/namespace/" 45 | 46 | ./add-class.sh \ 47 | -b "${base}admin/" \ 48 | -f "$cert_pem_file" \ 49 | -p "$cert_password" \ 50 | --proxy "$proxy" \ 51 | --uri "${base}ns#Library" \ 52 | --label "Library" \ 53 | --slug library \ 54 | --sub-class-of "https://schema.org/Library" \ 55 | "${base}admin/ontologies/namespace/" 56 | 57 | ./add-class.sh \ 58 | -b "${base}admin/" \ 59 | -f "$cert_pem_file" \ 60 | -p "$cert_password" \ 61 | --proxy "$proxy" \ 62 | --uri "${base}ns#ParkingFacility" \ 63 | --label "Parking facility" \ 64 | --slug parking-facility \ 65 | --sub-class-of "https://schema.org/ParkingFacility" \ 66 | "${base}admin/ontologies/namespace/" 67 | 68 | ./add-class.sh \ 69 | -b "${base}admin/" \ 70 | -f "$cert_pem_file" \ 71 | -p "$cert_password" \ 72 | --proxy "$proxy" \ 73 | --uri "${base}ns#Place" \ 74 | --label "Place" \ 75 | --slug place \ 76 | --sub-class-of "https://schema.org/CivicStructure" \ 77 | "${base}admin/ontologies/namespace/" 78 | 79 | ./add-class.sh \ 80 | -b "${base}admin/" \ 81 | -f "$cert_pem_file" \ 82 | -p "$cert_password" \ 83 | --proxy "$proxy" \ 84 | --uri "${base}ns#Playground" \ 85 | --label "Playground" \ 86 | --slug playground \ 87 | --sub-class-of "https://schema.org/Playground" \ 88 | "${base}admin/ontologies/namespace/" 89 | 90 | ./add-class.sh \ 91 | -b "${base}admin/" \ 92 | -f "$cert_pem_file" \ 93 | -p "$cert_password" \ 94 | --proxy "$proxy" \ 95 | --uri "${base}ns#School" \ 96 | --label "School" \ 97 | --slug school \ 98 | --sub-class-of "https://schema.org/School" \ 99 | "${base}admin/ontologies/namespace/" 100 | 101 | ./add-class.sh \ 102 | -b "${base}admin/" \ 103 | -f "$cert_pem_file" \ 104 | -p "$cert_password" \ 105 | --proxy "$proxy" \ 106 | --uri "${base}ns#SportsCenter" \ 107 | --label "Sports center" \ 108 | --slug sports-center \ 109 | --sub-class-of "https://schema.org/CivicStructure" \ 110 | "${base}admin/ontologies/namespace/" 111 | 112 | ./add-class.sh \ 113 | -b "${base}admin/" \ 114 | -f "$cert_pem_file" \ 115 | -p "$cert_password" \ 116 | --proxy "$proxy" \ 117 | --uri "${base}ns#PublicToilet" \ 118 | --label "Toilet" \ 119 | --slug public-toilet \ 120 | --sub-class-of "http://schema.org/PublicToilet" \ 121 | "${base}admin/ontologies/namespace/" 122 | 123 | popd -------------------------------------------------------------------------------- /demo/city-graph/admin/model/add-imports.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/demo/city-graph/ ../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT/admin" 23 | 24 | ./add-ontology-import.sh \ 25 | -f "$cert_pem_file" \ 26 | -p "$cert_password" \ 27 | --proxy "$proxy" \ 28 | --import "https://schema.org" \ 29 | "${base}admin/ontologies/namespace/" 30 | 31 | popd -------------------------------------------------------------------------------- /demo/city-graph/create-charts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pwd=$(realpath "$PWD") 23 | 24 | pushd . && cd "$SCRIPT_ROOT" 25 | 26 | chart_container=$(./create-container.sh \ 27 | -b "$base" \ 28 | -f "$cert_pem_file" \ 29 | -p "$cert_password" \ 30 | --proxy "$proxy" \ 31 | --title "Charts" \ 32 | --slug "charts" \ 33 | --parent "$parent" \ 34 | --mode "https://w3id.org/atomgraph/client#MapMode" 35 | ) 36 | 37 | parking_facilities_doc=$(./create-item.sh \ 38 | -b "${base}admin/" \ 39 | -f "$cert_pem_file" \ 40 | -p "$cert_password" \ 41 | --proxy "$proxy" \ 42 | --title "Parking facilities" \ 43 | --slug "parking-facilities" \ 44 | --container "$chart_container" 45 | ) 46 | 47 | ./add-select.sh \ 48 | -b "$base" \ 49 | -f "$cert_pem_file" \ 50 | -p "$cert_password" \ 51 | --proxy "$proxy" \ 52 | --title "Largest parking facilities" \ 53 | --fragment "parking-facilities-by-spaces" \ 54 | --query-file "${pwd}/queries/charts/parking-facilities-by-spaces.rq" 55 | "$parking_facilities_doc" 56 | 57 | pushd . > /dev/null && cd "$SCRIPT_ROOT" 58 | 59 | query_ntriples=$(./get.sh \ 60 | -f "$cert_pem_file" \ 61 | -p "$cert_password" \ 62 | --proxy "$proxy" \ 63 | --accept 'application/n-triples' \ 64 | "$query_doc") 65 | 66 | popd > /dev/null 67 | 68 | query=$(echo "$query_ntriples" | sed -rn "s/<${query_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 69 | 70 | ./create-result-set-chart.sh \ 71 | -b "$base" \ 72 | -f "$cert_pem_file" \ 73 | -p "$cert_password" \ 74 | --proxy "$proxy" \ 75 | --title "Largest parking facilities" \ 76 | --slug largest-parkings \ 77 | --query "$query" \ 78 | --chart-type "https://w3id.org/atomgraph/client#BarChart" \ 79 | --category-var-name "name" \ 80 | --series-var-name "spaces" 81 | # --fragment this \ 82 | 83 | popd 84 | -------------------------------------------------------------------------------- /demo/city-graph/create-containers.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file="$(realpath "$2")" 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT" 23 | 24 | parent=$( 25 | ./create-container.sh \ 26 | -b "$base" \ 27 | -f "$cert_pem_file" \ 28 | -p "$cert_password" \ 29 | --proxy "$proxy" \ 30 | --title "Copenhagen" \ 31 | --slug "copenhagen" \ 32 | --parent "$base" 33 | ) 34 | 35 | if [ -z "$parent" ]; then 36 | exit 1 37 | fi 38 | 39 | ./create-container.sh \ 40 | -b "$base" \ 41 | -f "$cert_pem_file" \ 42 | -p "$cert_password" \ 43 | --proxy "$proxy" \ 44 | --title "Places" \ 45 | --slug "places" \ 46 | --parent "$parent" \ 47 | --mode "https://w3id.org/atomgraph/client#MapMode" 48 | 49 | ./create-container.sh \ 50 | -b "$base" \ 51 | -f "$cert_pem_file" \ 52 | -p "$cert_password" \ 53 | --proxy "$proxy" \ 54 | --title "Bicycle parkings" \ 55 | --slug "bicycle-parkings" \ 56 | --parent "$parent" \ 57 | --mode "https://w3id.org/atomgraph/client#MapMode" 58 | 59 | ./create-container.sh \ 60 | -b "$base" \ 61 | -f "$cert_pem_file" \ 62 | -p "$cert_password" \ 63 | --proxy "$proxy" \ 64 | --title "Charging stations" \ 65 | --slug "charging-stations" \ 66 | --parent "$parent" \ 67 | --mode "https://w3id.org/atomgraph/client#MapMode" 68 | 69 | ./create-container.sh \ 70 | -b "$base" \ 71 | -f "$cert_pem_file" \ 72 | -p "$cert_password" \ 73 | --proxy "$proxy" \ 74 | --title "Libraries" \ 75 | --slug "libraries" \ 76 | --parent "$parent" \ 77 | --mode "https://w3id.org/atomgraph/client#MapMode" 78 | 79 | ./create-container.sh \ 80 | -b "$base" \ 81 | -f "$cert_pem_file" \ 82 | -p "$cert_password" \ 83 | --proxy "$proxy" \ 84 | --title "Parking facilities" \ 85 | --slug "parking-facilities" \ 86 | --parent "$parent" \ 87 | --mode "https://w3id.org/atomgraph/client#MapMode" 88 | 89 | ./create-container.sh \ 90 | -b "$base" \ 91 | -f "$cert_pem_file" \ 92 | -p "$cert_password" \ 93 | --proxy "$proxy" \ 94 | --title "Playgrounds" \ 95 | --slug "playgrounds" \ 96 | --parent "$parent" \ 97 | --mode "https://w3id.org/atomgraph/client#MapMode" 98 | 99 | ./create-container.sh \ 100 | -b "$base" \ 101 | -f "$cert_pem_file" \ 102 | -p "$cert_password" \ 103 | --proxy "$proxy" \ 104 | --title "Schools" \ 105 | --slug "schools" \ 106 | --parent "$parent" \ 107 | --mode "https://w3id.org/atomgraph/client#MapMode" 108 | 109 | ./create-container.sh \ 110 | -b "$base" \ 111 | -f "$cert_pem_file" \ 112 | -p "$cert_password" \ 113 | --proxy "$proxy" \ 114 | --title "Sport centers" \ 115 | --slug "sports-centers" \ 116 | --parent "$parent" \ 117 | --mode "https://w3id.org/atomgraph/client#MapMode" 118 | 119 | ./create-container.sh \ 120 | -b "$base" \ 121 | -f "$cert_pem_file" \ 122 | -p "$cert_password" \ 123 | --proxy "$proxy" \ 124 | --title "Public toilets" \ 125 | --slug "public-toilets" \ 126 | --parent "$parent" \ 127 | --mode "https://w3id.org/atomgraph/client#MapMode" 128 | 129 | popd -------------------------------------------------------------------------------- /demo/city-graph/files/copenhagen/libraries.csv: -------------------------------------------------------------------------------- 1 | FID,wkb_geometry,long,lat,name,address,postcode,postdistrikt,email,link 2 | biblioteker.0,POINT (12.581745359843794 55.69457326676311),12.58174536,55.69457327,Østerbro Bibliotek,Dag Hammarskjölds Allé 19,2100,København Ø,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/oesterbro 3 | biblioteker.1,POINT (12.5131070384209 55.6653427353054),12.51310704,55.66534274,Valby Bibliotek,Annexstræde 2,2500,Valby,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/valby 4 | biblioteker.2,POINT (12.580964243346905 55.63128647629463),12.58096424,55.63128648,Ørestad Bibliotek,Arne Jacobsens Allé 19,2300,København S,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/orestad 5 | biblioteker.3,POINT (12.556770109039634 55.68609122692412),12.55677011,55.68609123,Blågårdens Bibliotek,Blågårds Plads 5,2200,København N,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/blaagaardens 6 | biblioteker.4,POINT (12.543641614525315 55.6990123375313),12.54364161,55.69901234,Nørrebro Bibliotek,Bragesgade 8b,2200,København N,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/noerrebro 7 | biblioteker.5,POINT (12.576494590600904 55.70916603955145),12.57649459,55.70916604,Øbro Jagtvej Bibliotek,Jagtvej 227,2100,København Ø,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/oebro-jagtvej 8 | biblioteker.6,POINT (12.477235738923248 55.71075510821146),12.47723574,55.71075511,Husum Bibliotek,Frederikssundsvej 290,2700,Brønshøj,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/husum 9 | biblioteker.7,POINT (12.499257114847524 55.704311905770986),12.49925711,55.70431191,Brønshøj Bibliotek,Frederikssundsvej 175,2700,Brønshøj,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/broenshoej 10 | biblioteker.8,POINT (12.59212091966293 55.67232124045602),12.59212092,55.67232124,Christianshavns Bibliotek,Dronningensgade 53,1420,København K,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/christianshavn 11 | biblioteker.9,POINT (12.57937591294882 55.666467503403034),12.57937591,55.6664675,Islands Brygge Bibliotek,Njalsgade 15,2300,København S,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/islands-brygge 12 | biblioteker.10,POINT (12.603936487981368 55.665203677828174),12.60393649,55.66520368,Sundby Bibliotek,Jemtelandsgade 3,2300,København S,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/sundby 13 | biblioteker.11,POINT (12.49130887528394 55.68652214248285),12.49130888,55.68652214,Kulturstationen Vanløse,Jernbane Allé 38,2720,Vanløse,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/vanloese 14 | biblioteker.12,POINT (12.503313355608507 55.6492308208943),12.50331336,55.64923082,Vigerslev Bibliotek,Kirsebærhaven 23,2500,Valby,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/vigerslev 15 | biblioteker.13,POINT (12.573653234093157 55.68087610562476),12.57365323,55.68087611,Hovedbiblioteket,Krystalgade 15,1172,København K,bibliotek@kff.kk.dk,https://bibliotek.kk.dk/bibliotek/hovedbiblioteket 16 | biblioteker.14,POINT (12.543715195841289 55.66782679418936),12.5437152,55.66782679,Kulturanstalten - Vesterbro Bibliotek,Lyrskovgade 4,1758,København V,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/vesterbro 17 | biblioteker.15,POINT (12.595484064660932 55.64872227604868),12.59548406,55.64872228,Solvang Bibliotek,Remisevej 14,2300,København S,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/solvang 18 | biblioteker.16,POINT (12.522916217324196 55.70841203177259),12.52291622,55.70841203,BIBLIOTEKET Rentemestervej,Rentemestervej 76,2400,København NV,bibliotek@kff.kk.dk,https://bibliotek.kk.dk/bibliotek/rentemestervej 19 | biblioteker.17,POINT (12.613150562287347 55.65034949033002),12.61315056,55.65034949,Bibliotekshuset,Rodosvej 4,2300,København S,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/bibliotekshuset 20 | biblioteker.18,POINT (12.48119514014686 55.7188555933771),12.48119514,55.71885559,Tingbjerg Bibliotek,Ruten 14,2700,Brønshøj,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/tingbjerg 21 | biblioteker.19,POINT (12.529663800582032 55.646928020969895),12.5296638,55.64692802,Sydhavnens Bibliotek,Wagnersvej 19,2450,København SV,bibliotek@kff.kk.dk,http://bibliotek.kk.dk/bibliotek/sydhavn -------------------------------------------------------------------------------- /demo/city-graph/files/copenhagen/parking-facilities.csv: -------------------------------------------------------------------------------- 1 | postDistrict,roadCode,houseNumber,name,FID,wkb_geometry,long,lat,address,postcode,parkingSpace,owner,parkingType,information 2 | 1304 København K,24,5,Adelgade 5 p_hus.0,p_hus.0,POINT (12.582287325059744 55.68268042120522),12.58228733,55.68268042,Adelgade 5,1304,92,Privat,P-Kælder,"Adelgade 5-7, Q-park." 3 | 1550 København V,148,18,H.C. Andersens Boulevard 18 p_hus.1,p_hus.1,POINT (12.568390493094558 55.6750773715323),12.56839049,55.67507737,H.C. Andersens Boulevard 18,1550,137,Privat,P-Kælder,"H.C. Andersens Boulevard, Industriens Hus" 4 | 1064 København K,264,1,Asylgade 1 p_hus.2,p_hus.2,POINT (12.584113225182094 55.67847304803938),12.58411323,55.67847305,Asylgade 1,1064,105,Privat,P-Hus,"Asylgade 1, Danske Bank." 5 | 2300 København S,472,19,Bergthorasgade 19 p_hus.3,p_hus.3,POINT (12.579836928457068 55.66454928142982),12.57983693,55.66454928,Bergthorasgade 19,2300,408,Kommune,Underjordisk P-anlæg,"Underjordisk P-anlæg, ibrugtaget februar 2011 og drevet af Center for Parkering." 6 | 2200 København N,628,57,Blågårdsgade 57 p_hus.4,p_hus.4,POINT (12.555695074664309 55.68417438048765),12.55569507,55.68417438,Blågårdsgade 57,2200,215,Kommune,P-Hus,"Det Grønne P-hus, ibrugtaget januar 2010 og drevet af Center for Parkering." 7 | 1069 København K,832,6,Bremerholm 6 p_hus.5,p_hus.5,POINT (12.583088623374682 55.67886909161786),12.58308862,55.67886909,Bremerholm 6,1069,214,Privat,P-Hus,"Magasin, Bremerholm" 8 | 2400 København NV,984,11,Bygmestervej 11 p_hus.6,p_hus.6,POINT (12.53638818652269 55.70522755910492),12.53638819,55.70522756,Bygmestervej 11,2400,180,Privat,P-Kælder,"P-huset tilbyder cykelparkering, for dem der parkerer bil i anlægget og ønsker at transportere sig videre på cykel" 9 | 1302 København K,1356,4,Dronningens Tværgade 4 p_hus.7,p_hus.7,POINT (12.588435643558675 55.68330403523282),12.58843564,55.68330404,Dronningens Tværgade 4,1302,320,Privat,P-Hus,"Jeudan Parkering, Dronningens Tværgade" 10 | 1117 København K,2104,3/1/2015,Gammel Mønt p_hus.8,p_hus.8,POINT (12.58162337622236 55.68075912424795),12.58162338,55.68075912,Gammel Mønt,1117,300,Privat,P-Hus,"Jeudan Parkering, Gammel Mønt" 11 | 1705 København V,3272,,Ingerslevsgade p_hus.9,p_hus.9,POINT (12.563434375186208 55.668893325597395),12.56343438,55.66889333,Ingerslevsgade,1705,192,Privat,P-Hus,DGI-byen indkørsel fra Ingerslevsgade 12 | 1361 København K,3310,1,Israels Plads 1 p_hus.10,p_hus.10,POINT (12.568404237139843 55.68251121101974),12.56840424,55.68251121,Israels Plads 1,1361,1150,Privat,P-Kælder,"Israels Plads, Q-park Indkørsel fra Linnésgade" 13 | 1301 København K,4112,10,Landgreven 10 p_hus.11,p_hus.11,POINT (12.58574292261366 55.68308805017006),12.58574292,55.68308805,Landgreven 10,1301,121,Privat,P-Hus,"Landgreven, Europark" 14 | 1602 København V,5128,36,Nyropsgade 36 p_hus.12,p_hus.12,POINT (12.560670163895672 55.676721900132314),12.56067016,55.6767219,Nyropsgade 36,1602,365,Privat,P-Kælder,Indkøsel ved Nyropsgade 36 15 | 2200 København N,5188,2D,Nørre Allé 2D p_hus.13,p_hus.13,POINT (12.561251427921016 55.69219515016364),12.56125143,55.69219515,Nørre Allé 2D,2200,164,Kommune,Underjordisk P-anlæg,"Underjordisk P-anlæg, ibrugtaget juni 2010 og drevet af Center for Parkering." 16 | 1759 København V,5792,8B,Rejsbygade 8B p_hus.14,p_hus.14,POINT (12.543254363515572 55.66897769124984),12.54325436,55.66897769,Rejsbygade 8B,1759,77,Kommune,P-Hus,Ibrugtaget februar 2008 og drevet af Center for Parkering. 17 | 2200 København N,6040,22,Ryesgade 22 p_hus.15,p_hus.15,POINT (12.567176379844057 55.69176488573952),12.56717638,55.69176489,Ryesgade 22,2200,56,Kommune,P-Hus,Sølund 18 | 2200 København N,6040,16,Ryesgade 16 p_hus.16,p_hus.16,POINT (12.565611062343194 55.69057204953302),12.56561106,55.69057205,Ryesgade 16,2200,25,Kommune,P-Hus,Sølund 19 | 1113 København K,6392,4,Silkegade 4 p_hus.17,p_hus.17,POINT (12.579741748315502 55.67985691403492),12.57974175,55.67985691,Silkegade 4,1113,140,Privat,P-Hus,"Silkegade 4, Illum" 20 | 2300 København S,7844,5,Under Elmene 5 p_hus.18,p_hus.18,POINT (12.598048055798772 55.6651551945516),12.59804806,55.66515519,Under Elmene 5,2300,268,Kommune,Underjordisk P-anlæg,"Underjordisk P-anlæg, ibrugtaget april 2011 og drevet af Center for Parkering." -------------------------------------------------------------------------------- /demo/city-graph/files/vilnius/Mokiniai.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/city-graph/files/vilnius/Mokiniai.csv -------------------------------------------------------------------------------- /demo/city-graph/import-csv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | imports_csv="$(dirname "$(realpath "$0")")/imports.csv" 16 | 17 | if [ -n "$4" ]; then 18 | proxy="$4" 19 | else 20 | proxy="$base" 21 | fi 22 | 23 | titles=() 24 | queries=() 25 | files=() 26 | 27 | pwd=$(realpath "$PWD") 28 | 29 | pushd . && cd "$SCRIPT_ROOT"/imports 30 | 31 | arr_csv=() 32 | while IFS= read -r line 33 | do 34 | arr_csv+=("$line") 35 | done < <(tail -n +2 "$imports_csv") 36 | 37 | index=0 38 | for row in "${arr_csv[@]}" 39 | do 40 | query_filename=$(echo "$row" | cut -d "," -f 1) 41 | csv_filename=$(echo "$row" | cut -d "," -f 2) 42 | title=$(echo "$row" | cut -d "," -f 3) 43 | 44 | titles+=("$title") 45 | 46 | # create query 47 | 48 | query_doc=$(./create-query.sh \ 49 | -b "$base" \ 50 | -f "$cert_pem_file" \ 51 | -p "$cert_password" \ 52 | --proxy "$proxy" \ 53 | --title "$title" \ 54 | --query-file "$pwd/${query_filename}") 55 | 56 | pushd . > /dev/null && cd "$SCRIPT_ROOT" 57 | 58 | query_ntriples=$(./get.sh \ 59 | -f "$cert_pem_file" \ 60 | -p "$cert_password" \ 61 | --proxy "$proxy" \ 62 | --accept 'application/n-triples' \ 63 | "$query_doc") 64 | 65 | popd > /dev/null 66 | 67 | query=$(echo "$query_ntriples" | sed -rn "s/<${query_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 68 | queries+=("$query") 69 | 70 | # upload file 71 | 72 | file_doc=$(./create-file.sh \ 73 | -b "$base" \ 74 | -f "$cert_pem_file" \ 75 | -p "$cert_password" \ 76 | --proxy "$proxy" \ 77 | --title "$title" \ 78 | --file "$pwd/${csv_filename}" \ 79 | --file-content-type "text/csv") 80 | 81 | pushd . > /dev/null && cd "$SCRIPT_ROOT" 82 | 83 | file_ntriples=$(./get.sh \ 84 | -f "$cert_pem_file" \ 85 | -p "$cert_password" \ 86 | --proxy "$proxy" \ 87 | --accept 'application/n-triples' \ 88 | "$file_doc") 89 | 90 | popd > /dev/null 91 | 92 | file=$(echo "$file_ntriples" | sed -rn "s/<${file_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 93 | files+=("$file") 94 | 95 | # iterate 96 | 97 | ((index++)) 98 | done 99 | 100 | # start imports - postpone until after documents are created so we don't get concurrent updates to the triplestore 101 | 102 | for i in "${!files[@]}"; do 103 | printf "\n### Importing CSV from %s\n\n" "${files[$i]}" 104 | 105 | ./create-csv-import.sh \ 106 | -b "$base" \ 107 | -f "$cert_pem_file" \ 108 | -p "$cert_password" \ 109 | --proxy "$proxy" \ 110 | --title "${titles[$i]}" \ 111 | --query "${queries[$i]}" \ 112 | --file "${files[$i]}" \ 113 | --delimiter "," 114 | done 115 | 116 | popd -------------------------------------------------------------------------------- /demo/city-graph/imports.csv: -------------------------------------------------------------------------------- 1 | query_filename,csv_filename,title 2 | queries/imports/copenhagen/places.rq,files/copenhagen/places.csv,Places 3 | queries/imports/copenhagen/bicycle-parkings.rq,files/copenhagen/bicycle-parkings.csv,Bicycle parkings 4 | queries/imports/copenhagen/charging-stations.rq,files/copenhagen/charging-stations.csv,Charging stations 5 | queries/imports/copenhagen/libraries.rq,files/copenhagen/libraries.csv,Libraries 6 | queries/imports/copenhagen/parking-facilities.rq,files/copenhagen/parking-facilities.csv,Parking facilities 7 | queries/imports/copenhagen/playgrounds.rq,files/copenhagen/playgrounds.csv,Playgrounds 8 | queries/imports/copenhagen/schools.rq,files/copenhagen/schools.csv,Schools 9 | queries/imports/copenhagen/sports-centers.rq,files/copenhagen/sports-centers.csv,Sports centers 10 | queries/imports/copenhagen/public-toilets.rq,files/copenhagen/public-toilets.csv,Public toilets 11 | -------------------------------------------------------------------------------- /demo/city-graph/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | printf "\n### Creating authorization to make the app public\n\n" 21 | 22 | "$SCRIPT_ROOT"/admin/acl/make-public.sh -b "$base" -f "$cert_pem_file" -p "$cert_password" --proxy "$proxy" 23 | 24 | cd admin/model 25 | 26 | # printf "\n### Adding schema.org import to domain ontology\n\n" 27 | # disable schema.org as import because its URI does not resolve to an ontology 28 | # ./add-imports.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 29 | 30 | printf "\n### Creating classes\n\n" 31 | 32 | ./create-classes.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 33 | 34 | cd .. 35 | 36 | printf "\n### Clearing ontologies\n\n" 37 | 38 | ./clear-ontologies.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 39 | 40 | cd .. 41 | 42 | printf "\n### Updating documents\n\n" 43 | 44 | ./update-documents.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 45 | 46 | printf "\n### Creating containers\n\n" 47 | 48 | ./create-containers.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 49 | 50 | printf "\n### Creating charts\n\n" 51 | 52 | ./create-charts.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 53 | 54 | printf "\n### Importing CSV data\n\n" 55 | 56 | ./import-csv.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" -------------------------------------------------------------------------------- /demo/city-graph/queries/charts/parking-facilities-by-spaces.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | PREFIX dct: 3 | 4 | SELECT DISTINCT ?name ?spaces 5 | WHERE 6 | { 7 | GRAPH ?g 8 | { ?parking a schema:ParkingFacility ; 9 | dct:title ?name ; 10 | schema:maximumAttendeeCapacity ?spaces . 11 | } 12 | } 13 | ORDER BY DESC(?spaces) 14 | LIMIT 100 -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/bicycle-parkings.rq: -------------------------------------------------------------------------------- 1 | PREFIX ns: 2 | PREFIX foaf: 3 | PREFIX dct: 4 | PREFIX dbo: 5 | PREFIX schema: 6 | PREFIX geo: 7 | PREFIX xsd: 8 | PREFIX rdf: 9 | PREFIX dh: 10 | PREFIX sioc: 11 | 12 | CONSTRUCT 13 | { 14 | GRAPH ?item 15 | { 16 | ?item a dh:Item ; 17 | sioc:has_container ?container ; 18 | dh:slug ?id ; 19 | dct:title ?name ; 20 | foaf:primaryTopic ?bicyleParking . 21 | 22 | ?bicyleParking a ns:BicycleParking ; 23 | geo:lat ?lat ; 24 | geo:long ?long ; 25 | dct:title ?name ; 26 | dbo:city ?city ; 27 | schema:streetAddress ?address ; 28 | schema:maximumAttendeeCapacity ?spaces ; 29 | dct:identifier ?id . 30 | } 31 | } 32 | WHERE 33 | { 34 | ?bicyleParking <#FID> ?id ; 35 | <#lat> ?lat_string ; 36 | <#long> ?long_string . 37 | 38 | OPTIONAL 39 | { ?bicyleParking <#name> ?name } 40 | OPTIONAL 41 | { ?bicyleParking <#bydel> ?city } 42 | OPTIONAL 43 | { ?bicyleParking <#vejnavn> ?address } 44 | OPTIONAL 45 | { ?bicyleParking <#antal_pladser> ?spaces } 46 | 47 | BIND(uri(concat(str($base), "copenhagen/bicycle-parkings/")) AS ?container) 48 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 49 | BIND(xsd:float(?lat_string) AS ?lat) 50 | BIND(xsd:float(?long_string) AS ?long) 51 | 52 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/charging-stations.rq: -------------------------------------------------------------------------------- 1 | PREFIX ns: 2 | PREFIX foaf: 3 | PREFIX dct: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX rdf: 8 | PREFIX dh: 9 | PREFIX sioc: 10 | 11 | CONSTRUCT 12 | { 13 | GRAPH ?item 14 | { 15 | ?item a dh:Item ; 16 | sioc:has_container ?container ; 17 | dh:slug ?id ; 18 | dct:title ?name ; 19 | foaf:primaryTopic ?charger . 20 | 21 | ?charger a ns:ChargingStation ; 22 | geo:lat ?lat ; 23 | geo:long ?long ; 24 | schema:streetAddress ?address ; 25 | dct:title ?name ; 26 | schema:additionalProperty ?chargeType ; 27 | schema:maximumAttendeeCapacity ?spaces ; 28 | schema:serviceOperator ?operator ; 29 | schema:comment ?information ; 30 | dct:identifier ?id . 31 | } 32 | } 33 | WHERE 34 | { 35 | ?charger <#FID> ?id ; 36 | <#lat> ?lat_string ; 37 | <#long> ?long_string . 38 | 39 | OPTIONAL 40 | { ?charger <#name> ?name } 41 | OPTIONAL 42 | { ?charger <#chargeType> ?chargeType } 43 | OPTIONAL 44 | { ?charger <#address> ?address } 45 | OPTIONAL 46 | { ?charger <#antal_udtag> ?spaces } 47 | OPTIONAL 48 | { ?charger <#operator> ?operator } 49 | OPTIONAL 50 | { ?charger <#bem> ?information } 51 | 52 | BIND(uri(concat(str($base), "copenhagen/charging-stations/")) AS ?container) 53 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 54 | BIND(xsd:float(?lat_string) AS ?lat) 55 | BIND(xsd:float(?long_string) AS ?long) 56 | 57 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/libraries.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX dbo: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX rdf: 8 | PREFIX dh: 9 | PREFIX sioc: 10 | 11 | CONSTRUCT 12 | { 13 | GRAPH ?item 14 | { 15 | ?item a dh:Item ; 16 | sioc:has_container ?container ; 17 | dh:slug ?id ; 18 | dct:title ?name ; 19 | foaf:primaryTopic ?library . 20 | 21 | ?library a schema:Library ; 22 | geo:lat ?lat ; 23 | geo:long ?long ; 24 | dct:title ?name ; 25 | schema:streetAddress ?address ; 26 | schema:postalCode ?postcode ; 27 | dbo:district ?district ; 28 | foaf:page ?link ; 29 | foaf:mbox ?email ; 30 | dct:identifier ?id . 31 | } 32 | } 33 | WHERE 34 | { 35 | ?library <#FID> ?id ; 36 | <#name> ?name ; 37 | <#address> ?address ; 38 | <#lat> ?lat_string ; 39 | <#postcode> ?postcode ; 40 | <#postdistrikt> ?district ; 41 | <#long> ?long_string . 42 | 43 | OPTIONAL 44 | { 45 | ?library <#email> ?emailString 46 | BIND (URI(CONCAT(STR(), ?emailString)) AS ?email) 47 | } 48 | OPTIONAL 49 | { 50 | ?library <#link> ?linkString 51 | BIND (URI(?linkString) AS ?link) 52 | } 53 | 54 | BIND(uri(concat(str($base), "copenhagen/libraries/")) AS ?container) 55 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 56 | BIND(xsd:float(?lat_string) AS ?lat) 57 | BIND(xsd:float(?long_string) AS ?long) 58 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/parking-facilities.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX dbo: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX rdf: 8 | PREFIX dh: 9 | PREFIX sioc: 10 | 11 | CONSTRUCT 12 | { 13 | GRAPH ?item 14 | { 15 | ?item a dh:Item ; 16 | sioc:has_container ?container ; 17 | dh:slug ?id ; 18 | dct:title ?name ; 19 | foaf:primaryTopic ?parking . 20 | 21 | ?parking a schema:ParkingFacility ; 22 | geo:lat ?lat ; 23 | geo:long ?long ; 24 | dct:title ?name ; 25 | schema:streetAddress ?address ; 26 | schema:postalCode ?postcode ; 27 | schema:maximumAttendeeCapacity ?spaces ; 28 | schema:additionalProperty ?parkingType ; 29 | schema:comment ?information ; 30 | schema:identifier ?id . 31 | ?owner a ?ownerType ; 32 | schema:owns ?parking . 33 | } 34 | } 35 | WHERE 36 | { 37 | ?parking <#FID> ?id ; 38 | <#name> ?name ; 39 | <#address> ?address ; 40 | <#lat> ?lat_string ; 41 | <#postcode> ?postcode ; 42 | <#parkingSpace> ?spaces_string ; 43 | <#parkingType> ?parkingType ; 44 | <#information> ?information ; 45 | <#long> ?long_string . 46 | { 47 | ?parking <#owner> 'Privat' . 48 | BIND(BNODE() AS ?owner) 49 | BIND(schema:Corporation AS ?ownerType) 50 | } 51 | UNION 52 | { 53 | ?parking <#owner> 'Kommune' . 54 | BIND ( AS ?owner) # Copenhagen Municipality 55 | } 56 | 57 | BIND(uri(concat(str($base), "copenhagen/parking-facilities/")) AS ?container) 58 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 59 | BIND(xsd:float(?lat_string) AS ?lat) 60 | BIND(xsd:float(?long_string) AS ?long) 61 | BIND(xsd:integer(?spaces_string) AS ?spaces) 62 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/places.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | PREFIX geo: 3 | PREFIX dh: 4 | PREFIX dct: 5 | PREFIX rdf: 6 | PREFIX xsd: 7 | PREFIX skos: 8 | PREFIX foaf: 9 | PREFIX sioc: 10 | 11 | CONSTRUCT 12 | { 13 | GRAPH ?item 14 | { 15 | ?item a dh:Item ; 16 | sioc:has_container ?container ; 17 | dct:title ?name ; 18 | dh:slug ?id ; 19 | foaf:primaryTopic ?place . 20 | 21 | ?place a schema:Place ; 22 | geo:lat ?lat ; 23 | geo:long ?long ; 24 | dct:identifier ?id ; 25 | dct:title ?name ; 26 | dct:subject [ skos:prefLabel ?category_name ] . 27 | } 28 | } 29 | WHERE 30 | { 31 | ?place <#FID> ?id ; 32 | <#name> ?name ; 33 | <#lat> ?lat_string ; 34 | <#long> ?long_string 35 | 36 | OPTIONAL 37 | { ?place <#category> ?category_name } 38 | 39 | BIND(uri(concat(str($base), "copenhagen/places/")) AS ?container) 40 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 41 | BIND(xsd:float(?lat_string) AS ?lat) 42 | BIND(xsd:float(?long_string) AS ?long) 43 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/playgrounds.rq: -------------------------------------------------------------------------------- 1 | PREFIX dh: 2 | PREFIX foaf: 3 | PREFIX dct: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX rdf: 8 | PREFIX sioc: 9 | 10 | CONSTRUCT 11 | { 12 | GRAPH ?item 13 | { 14 | ?item a dh:Item ; 15 | sioc:has_container ?container ; 16 | dct:title ?name ; 17 | dh:slug ?id ; 18 | foaf:primaryTopic ?playground . 19 | 20 | ?playground a schema:Playground ; 21 | geo:lat ?lat ; 22 | geo:long ?long ; 23 | dct:identifier ?id ; 24 | dct:title ?name ; 25 | schema:streetAddress ?address_description; 26 | foaf:based_near [ dct:title ?area ] ; 27 | rdf:type [ dct:title ?playground_type ] ; 28 | schema:typicalAgeRange ?age_group ; 29 | dct:description ?description ; 30 | foaf:page ?link . 31 | } 32 | } 33 | WHERE 34 | { 35 | ?playground <#FID> ?id ; 36 | <#name> ?name ; 37 | <#address_description> ?address_description ; 38 | <#lat> ?lat_string ; 39 | <#long> ?long_string . 40 | 41 | OPTIONAL 42 | { ?playground <#area> ?area} 43 | OPTIONAL 44 | { ?playground <#playground_type> ?playground_type} 45 | OPTIONAL 46 | { ?playground <#age_group> ?age_group} 47 | OPTIONAL 48 | { ?playground <#description> ?description} 49 | OPTIONAL 50 | { ?playground <#link> ?linkString 51 | BIND (URI(?linkString) AS ?link)} 52 | 53 | BIND(uri(concat(str($base), "copenhagen/playgrounds/")) AS ?container) 54 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 55 | BIND(xsd:float(?lat_string) AS ?lat) . 56 | BIND(xsd:float(?long_string) AS ?long) . 57 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/public-toilets.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX dbo: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX dh: 8 | PREFIX sioc: 9 | 10 | CONSTRUCT 11 | { 12 | GRAPH ?item 13 | { 14 | ?item a dh:Item ; 15 | sioc:has_container ?container ; 16 | dh:slug ?id ; 17 | dct:title ?name ; 18 | foaf:primaryTopic ?toilet . 19 | 20 | ?toilet a schema:PublicToilet ; 21 | geo:lat ?lat ; 22 | geo:long ?long ; 23 | schema:streetAddress ?address ; 24 | schema:postalCode ?postcode ; 25 | schema:additionalProperty ?toiletType ; 26 | dbo:isHandicappedAccessible ?accessible ; 27 | schema:location ?location ; 28 | schema:comment ?comment ; 29 | schema:openingHours ?openingHours ; 30 | dct:identifier ?id ; 31 | dct:title ?name . 32 | } 33 | } 34 | WHERE 35 | { 36 | ?toilet <#FID> ?id ; 37 | <#title> ?name ; 38 | <#adresse> ?address ; 39 | <#latitude> ?lat_string ; 40 | <#longitude> ?long_string . 41 | 42 | OPTIONAL { ?toilet <#postnr> ?postcode } 43 | OPTIONAL { ?toilet <#toilet_type> ?toiletType } 44 | OPTIONAL { ?toilet <#handicapadgang> ?accessible } 45 | OPTIONAL { ?toilet <#placering> ?location } 46 | OPTIONAL { ?toilet <#aabningstid_bemrk> ?comment } 47 | OPTIONAL { ?toilet <#opening_hours> ?openingHours } 48 | 49 | BIND(uri(concat(str($base), "copenhagen/public-toilets/")) AS ?container) 50 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 51 | BIND(xsd:float(?lat_string) AS ?lat) 52 | BIND(xsd:float(?long_string) AS ?long) 53 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/schools.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX dbo: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX dh: 8 | PREFIX sioc: 9 | 10 | CONSTRUCT 11 | { 12 | GRAPH ?item 13 | { 14 | ?item a dh:Item ; 15 | sioc:has_container ?container ; 16 | dh:slug ?id ; 17 | dct:title ?name ; 18 | foaf:primaryTopic ?school . 19 | 20 | ?school a schema:School ; 21 | geo:lat ?lat ; 22 | geo:long ?long ; 23 | dct:title ?name ; 24 | schema:streetAddress ?address ; 25 | schema:postalCode ?postcode ; 26 | schema:addressRegion ?region ; 27 | dbo:city ?city ; 28 | foaf:page ?link ; 29 | dbo:district ?district ; 30 | dct:identifier ?id . 31 | } 32 | } 33 | WHERE 34 | { 35 | ?school <#FID> ?id ; 36 | <#navn> ?name ; 37 | <#address> ?address ; 38 | <#omraade> ?region ; 39 | <#lat> ?lat_string ; 40 | <#bydelnavn> ?city ; 41 | <#postnummer> ?postcode ; 42 | <#bby> ?district ; 43 | <#long> ?long_string . 44 | 45 | OPTIONAL 46 | { 47 | ?school <#link> ?linkString 48 | BIND (URI(?linkString) AS ?link) 49 | } 50 | 51 | BIND (uri(concat(str($base), "copenhagen/schools/")) AS ?container) 52 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 53 | BIND(xsd:float(?lat_string) AS ?lat) 54 | BIND(xsd:float(?long_string) AS ?long) 55 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/copenhagen/sports-centers.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX dbo: 4 | PREFIX schema: 5 | PREFIX geo: 6 | PREFIX xsd: 7 | PREFIX dh: 8 | PREFIX sioc: 9 | 10 | CONSTRUCT 11 | { 12 | GRAPH ?item 13 | { 14 | ?item a dh:Item ; 15 | sioc:has_container ?container ; 16 | dh:slug ?id ; 17 | dct:title ?name ; 18 | foaf:primaryTopic ?sportCenter . 19 | 20 | ?sportCenter a schema:SportsActivityLocation ; 21 | geo:lat ?lat ; 22 | geo:long ?long ; 23 | dct:title ?name ; 24 | schema:streetAddress ?address ; 25 | schema:postalCode ?postcode ; 26 | foaf:mbox ?email ; 27 | foaf:page ?link ; 28 | dct:identifier ?id . 29 | } 30 | } 31 | WHERE 32 | { 33 | ?sportCenter <#FID> ?id ; 34 | <#name> ?name ; 35 | <#address> ?address ; 36 | <#lat> ?lat_string ; 37 | <#postcode> ?postcode ; 38 | <#long> ?long_string . 39 | 40 | OPTIONAL { 41 | ?sportCenter <#email> ?emailString 42 | BIND (URI(CONCAT(STR(), ?emailString)) AS ?email) 43 | } 44 | OPTIONAL { 45 | ?sportCenter <#link> ?linkString 46 | BIND (URI(?linkString) AS ?link) 47 | } 48 | 49 | BIND(uri(concat(str($base), "copenhagen/sports-centers/")) AS ?container) 50 | BIND(uri(concat(str(?container), encode_for_uri(?id), "/")) AS ?item) 51 | BIND(xsd:float(?lat_string) AS ?lat) 52 | BIND(xsd:float(?long_string) AS ?long) 53 | } -------------------------------------------------------------------------------- /demo/city-graph/queries/imports/postal-areas.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX dbo: 4 | PREFIX schema: 5 | PREFIX xsd: 6 | PREFIX rdf: 7 | PREFIX dh: 8 | 9 | CONSTRUCT 10 | { 11 | ?item rdf:type ?itemType ; 12 | dh:slug ?postal_code ; 13 | dct:title ?city_name ; 14 | foaf:primaryTopic ?postalArea . 15 | ?postalArea a schema:PostalAddress ; 16 | dbo:postalCode ?postal_code ; 17 | dbo:municipality ?municipality ; 18 | dbo:municipalityCode ?municipalityCode ; 19 | dbo:county ?county ; 20 | dct:title ?city_name . 21 | } 22 | WHERE 23 | { 24 | BIND(uri(concat(str(?base), "default#Item")) AS ?itemType) 25 | BIND(uri(concat(str(?base), "ns#PostalArea")) AS ?type) 26 | BIND (BNODE() AS ?item) 27 | 28 | ?postalArea <#postal_code> ?postal_codeString ; 29 | <#city_name> ?city_name . 30 | 31 | BIND (xsd:integer(?postal_codeString) AS ?postal_code) . 32 | 33 | OPTIONAL 34 | { ?postalArea <#municipality_name> ?municipality } 35 | OPTIONAL 36 | { ?postalArea <#county_name> ?county } 37 | OPTIONAL 38 | { 39 | ?postalArea <#municipality_number> ?municipalityCodeString 40 | BIND (xsd:integer(?municipalityCodeString) AS ?municipalityCode) 41 | } 42 | } -------------------------------------------------------------------------------- /demo/city-graph/root.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix ac: . 4 | @prefix rdf: . 5 | @prefix xsd: . 6 | @prefix dh: . 7 | @prefix dct: . 8 | @prefix sioc: . 9 | 10 | <> a def:Root ; 11 | dct:title "Root" ; 12 | dct:description "Geospatial and other open data about cities, imported by transforming CSV files to RDF" ; 13 | rdf:_1 <#page-header> ; 14 | rdf:_2 <#main-library> ; 15 | rdf:_3 <#charts> ; 16 | rdf:_4 <#largest-parkings> ; 17 | rdf:_5 <#check-out> ; 18 | rdf:_6 <#select-children> . 19 | 20 | <#page-header> a ldh:Content ; 21 | rdf:value """
22 | 26 |

Features include CSV data imports, SPARQL-based charts, faceted search and related results (parallax navigation) as well as 27 | rich documents composed of structured content backed by RDF Knowledge Graph data.

28 |

This application was created on LinkedDataHub using the low code paradigm: no programming was required, only scripts that 29 | invoke LinkedDataHub's CLI commands.

30 |

For example, below we have embedded Copenhagen's Main Library in map mode.

31 |
"""^^rdf:XMLLiteral . 32 | 33 | <#main-library> a ldh:Content ; 34 | rdf:value ; 35 | ac:mode ac:MapMode . 36 | 37 | <#charts> a ldh:Content ; 38 | rdf:value """
39 |

What are the largest parking facilities in Copenhagen? Let's find out in this SPARQL-driven chart.

40 |
"""^^rdf:XMLLiteral . 41 | 42 | <#largest-parkings> a ldh:Content ; 43 | rdf:value . 44 | 45 | <#check-out> a ldh:Content ; 46 | rdf:value """
47 |

Check out the rest of Copenhagen's geodata in the collection below.

48 |
"""^^rdf:XMLLiteral . 49 | 50 | <#select-children> a ldh:Content ; 51 | rdf:value ldh:ChildrenView . -------------------------------------------------------------------------------- /demo/city-graph/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/city-graph/screenshot.png -------------------------------------------------------------------------------- /demo/city-graph/update-documents.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file="$2" 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | cat root.ttl | turtle --base="${base}" | "$SCRIPT_ROOT"/put.sh \ 23 | -f "$cert_pem_file" \ 24 | -p "$cert_password" \ 25 | --proxy "$proxy" \ 26 | -t "application/n-triples" \ 27 | "$base" -------------------------------------------------------------------------------- /demo/life-sciences/create-charts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pwd=$(realpath "$PWD") 23 | 24 | pushd . && cd "$SCRIPT_ROOT" 25 | 26 | #query=$( 27 | #./create-select.sh \ 28 | # -b "$base" \ 29 | # -f "$cert_pem_file" \ 30 | # -p "$cert_password" \ 31 | # --proxy "$proxy" \ 32 | # --title "Molecule logp" \ 33 | # --query-file "${pwd}/queries/chembl/molecule-logp.rq" \ 34 | # --service "${base}/services/chembl/#this" 35 | #) 36 | # 37 | #./create-result-set-chart.sh \ 38 | # -b "$base" \ 39 | # -f "$cert_pem_file" \ 40 | # -p "$cert_password" \ 41 | # --proxy "$proxy" \ 42 | # --title "Partition coefficients" \ 43 | # --query "${query}#this" \ 44 | # --chart-type https://w3id.org/atomgraph/client#BarChart \ 45 | # --category-var-name "mol_name" \ 46 | # --series-var-name "logp_val" 47 | 48 | query=$( 49 | ./create-select.sh \ 50 | -b "$base" \ 51 | -f "$cert_pem_file" \ 52 | -p "$cert_password" \ 53 | --proxy "$proxy" \ 54 | --title "Protein counts by organism" \ 55 | --query-file "${pwd}/queries/uniprot/select-protein-count-by-organism.rq" \ 56 | --service "${base}services/uniprot-enzymes/#this" 57 | ) 58 | 59 | ./create-result-set-chart.sh \ 60 | -b "$base" \ 61 | -f "$cert_pem_file" \ 62 | -p "$cert_password" \ 63 | --proxy "$proxy" \ 64 | --title "Protein counts by organism" \ 65 | --query "${query}#this" \ 66 | --chart-type https://w3id.org/atomgraph/client#BarChart \ 67 | --category-var-name "name" \ 68 | --series-var-name "count" 69 | 70 | popd 71 | -------------------------------------------------------------------------------- /demo/life-sciences/create-containers.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pwd=$(realpath "$PWD") 23 | 24 | pushd . && cd "$SCRIPT_ROOT" 25 | 26 | uniprot_container=$(./create-container.sh \ 27 | -b "$base" \ 28 | -f "$cert_pem_file" \ 29 | -p "$cert_password" \ 30 | --proxy "$proxy" \ 31 | --title "Uniprot" \ 32 | --slug "uniprot" \ 33 | --parent "$base" 34 | ) 35 | 36 | uniprot_service_doc="${base}services/uniprot/" 37 | 38 | uniprot_service_ntriples=$(./get.sh \ 39 | -f "$cert_pem_file" \ 40 | -p "$cert_password" \ 41 | --proxy "$proxy" \ 42 | --accept 'application/n-triples' \ 43 | "$uniprot_service_doc") 44 | 45 | uniprot_service=$(echo "$uniprot_service_ntriples" | sed -rn "s/<${uniprot_service_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 46 | 47 | select_proteins_doc=$( 48 | ./create-select.sh \ 49 | -b "$base" \ 50 | -f "$cert_pem_file" \ 51 | -p "$cert_password" \ 52 | --proxy "$proxy" \ 53 | --title "Proteins" \ 54 | --query-file "${pwd}/queries/uniprot/select-proteins.rq" \ 55 | --service "$uniprot_service" 56 | ) 57 | 58 | select_proteins_ntriples=$(./get.sh \ 59 | -f "$cert_pem_file" \ 60 | -p "$cert_password" \ 61 | --proxy "$proxy" \ 62 | --accept 'application/n-triples' \ 63 | "$select_proteins_doc") 64 | 65 | select_proteins=$(echo "$select_proteins_ntriples" | sed -rn "s/<${select_proteins_doc//\//\\/}> <(.*)> \./\1/p"| head -1) 66 | 67 | protein_container=$(./create-container.sh \ 68 | -b "$base" \ 69 | -f "$cert_pem_file" \ 70 | -p "$cert_password" \ 71 | --proxy "$proxy" \ 72 | --title "Proteins" \ 73 | --slug "proteins" \ 74 | --parent "$uniprot_container" 75 | ) 76 | 77 | ./remove-content.sh \ 78 | -f "$cert_pem_file" \ 79 | -p "$cert_password" \ 80 | --proxy "$proxy" \ 81 | "$protein_container" 82 | 83 | ./append-content.sh \ 84 | -f "$cert_pem_file" \ 85 | -p "$cert_password" \ 86 | --proxy "$proxy" \ 87 | --value "$select_proteins" \ 88 | "$protein_container" 89 | 90 | select_genes_doc=$( 91 | ./create-select.sh \ 92 | -b "$base" \ 93 | -f "$cert_pem_file" \ 94 | -p "$cert_password" \ 95 | --proxy "$proxy" \ 96 | --title "Genes" \ 97 | --query-file "${pwd}/queries/uniprot/select-genes.rq" \ 98 | --service "$uniprot_service" 99 | ) 100 | 101 | select_genes_ntriples=$(./get.sh \ 102 | -f "$cert_pem_file" \ 103 | -p "$cert_password" \ 104 | --proxy "$proxy" \ 105 | --accept 'application/n-triples' \ 106 | "$select_genes_doc") 107 | 108 | select_genes=$(echo "$select_genes_ntriples" | sed -rn "s/<${select_genes_doc//\//\\/}> <(.*)> \./\1/p"| head -1) 109 | 110 | gene_container=$(./create-container.sh \ 111 | -b "$base" \ 112 | -f "$cert_pem_file" \ 113 | -p "$cert_password" \ 114 | --proxy "$proxy" \ 115 | --title "Genes" \ 116 | --slug "genes" \ 117 | --parent "$uniprot_container" 118 | ) 119 | 120 | ./remove-content.sh \ 121 | -f "$cert_pem_file" \ 122 | -p "$cert_password" \ 123 | --proxy "$proxy" \ 124 | "$gene_container" 125 | 126 | ./append-content.sh \ 127 | -f "$cert_pem_file" \ 128 | -p "$cert_password" \ 129 | --proxy "$proxy" \ 130 | --value "$select_genes" \ 131 | "$gene_container" 132 | 133 | popd || exit -------------------------------------------------------------------------------- /demo/life-sciences/create-services.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT" 23 | 24 | service_doc=$(./create-item.sh \ 25 | -b "$base" \ 26 | -f "$cert_pem_file" \ 27 | -p "$cert_password" \ 28 | --proxy "$proxy" \ 29 | --title "Uniprot" \ 30 | --slug "uniprot" \ 31 | --container "${base}services/" 32 | ) 33 | 34 | ./create-generic-service.sh \ 35 | -b "$base" \ 36 | -f "$cert_pem_file" \ 37 | -p "$cert_password" \ 38 | --proxy "$proxy" \ 39 | --title "Uniprot" \ 40 | --endpoint https://sparql.uniprot.org/sparql \ 41 | --slug "uniprot" \ 42 | "$service_doc" 43 | 44 | popd 45 | -------------------------------------------------------------------------------- /demo/life-sciences/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | printf "\n### Creating authorization to make the app public\n\n" 21 | 22 | "$SCRIPT_ROOT"/admin/acl/make-public.sh -b "$base" -f "$cert_pem_file" -p "$cert_password" --proxy "$proxy" 23 | 24 | printf "\n### Creating services\n\n" 25 | 26 | ./create-services.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 27 | 28 | printf "\n### Creating containers\n\n" 29 | 30 | ./create-containers.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 31 | 32 | printf "\n### Creating charts\n\n" 33 | 34 | ./create-charts.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" -------------------------------------------------------------------------------- /demo/life-sciences/queries/chembl/molecule-logp.rq: -------------------------------------------------------------------------------- 1 | PREFIX skos: 2 | PREFIX rdfs: 3 | PREFIX foaf: 4 | PREFIX cco: 5 | 6 | SELECT DISTINCT ?molecule ?mol_name ?logp_val 7 | WHERE 8 | { { ?molecule a ?type . 9 | ?type rdfs:subClassOf cco:Substance . 10 | ?molecule cco:moleculeXref ?pubchem_id 11 | FILTER contains(str(?pubchem_id), "pubchem") 12 | ?molecule rdfs:label ?mol_name . 13 | } 14 | BIND(uri(concat(str(?molecule), "#acd_logp")) AS ?logp) 15 | ?molecule ?x ?logp . 16 | ?logp ?logp_val . 17 | } 18 | ORDER BY DESC(?logp_val) ?mol_name -------------------------------------------------------------------------------- /demo/life-sciences/queries/chembl/select-molecules.rq: -------------------------------------------------------------------------------- 1 | PREFIX rdfs: 2 | PREFIX cco: 3 | 4 | SELECT DISTINCT ?molecule 5 | WHERE 6 | { ?molecule a ?type . 7 | ?type rdfs:subClassOf cco:Substance . 8 | } -------------------------------------------------------------------------------- /demo/life-sciences/queries/uniprot/select-genes.rq: -------------------------------------------------------------------------------- 1 | PREFIX skos: 2 | PREFIX up: 3 | 4 | SELECT DISTINCT ?gene 5 | WHERE 6 | { ?gene a up:Gene ; 7 | skos:prefLabel ?label 8 | } 9 | ORDER BY ?label -------------------------------------------------------------------------------- /demo/life-sciences/queries/uniprot/select-protein-count-by-organism.rq: -------------------------------------------------------------------------------- 1 | PREFIX up: 2 | 3 | SELECT ?organism (SAMPLE(?scientificName) AS ?name) (COUNT(DISTINCT ?protein) AS ?count) 4 | { 5 | ?protein a up:Protein ; 6 | up:organism ?organism . 7 | ?organism up:scientificName ?scientificName . 8 | } 9 | GROUP BY ?organism 10 | ORDER BY DESC(?count) 11 | LIMIT 10 -------------------------------------------------------------------------------- /demo/life-sciences/queries/uniprot/select-proteins.rq: -------------------------------------------------------------------------------- 1 | PREFIX rdfs: 2 | PREFIX up: 3 | 4 | SELECT DISTINCT ?protein 5 | WHERE 6 | { ?protein a up:Protein ; 7 | up:organism ?taxon ; 8 | up:encodedBy ?gene ; 9 | rdfs:label ?label 10 | } 11 | ORDER BY ?label -------------------------------------------------------------------------------- /demo/life-sciences/root.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a def:Root ; 10 | dct:title "Root" ; 11 | dct:description "Life-sciences data explorer. Datasets from EBI RDF, ChEMBL, UniProt etc." ; 12 | rdf:_1 <#page-header> ; 13 | rdf:_2 <#select-children> . 14 | 15 | <#page-header> a ldh:Content ; 16 | rdf:value """
17 | 21 |
"""^^rdf:XMLLiteral . 22 | 23 | <#select-children> a ldh:Content ; 24 | rdf:value ldh:ChildrenView . -------------------------------------------------------------------------------- /demo/life-sciences/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/life-sciences/screenshot.png -------------------------------------------------------------------------------- /demo/northwind-traders/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | BASE_URL_DEFAULT=https://localhost:4443/ 4 | CERT_PATH_DEFAULT=../../../LinkedDataHub/ssl/owner/cert.pem 5 | PROXY_URL_DEFAULT=https://localhost:5443/ 6 | 7 | install: 8 | @read -p "Enter Base URL [$(BASE_URL_DEFAULT)]: " BASE_URL; \ 9 | BASE_URL=$${BASE_URL:-$(BASE_URL_DEFAULT)}; \ 10 | read -p "Enter Certificate Path [$(CERT_PATH_DEFAULT)]: " CERT_PATH; \ 11 | CERT_PATH=$${CERT_PATH:-$(CERT_PATH_DEFAULT)}; \ 12 | read -s -p "Enter Certificate Password (required): " PASSWORD; \ 13 | echo ""; \ 14 | if [ -z "$${PASSWORD}" ]; then \ 15 | echo "Password cannot be empty. Aborting."; \ 16 | exit 1; \ 17 | fi; \ 18 | read -p "Enter Proxy URL (optional) [$(PROXY_URL_DEFAULT)]: " PROXY_URL; \ 19 | if [ -n "$${PROXY_URL}" ]; then \ 20 | ./install.sh "$${BASE_URL}" "$${CERT_PATH}" "$${PASSWORD}" "$${PROXY_URL}"; \ 21 | else \ 22 | ./install.sh "$${BASE_URL}" "$${CERT_PATH}" "$${PASSWORD}"; \ 23 | fi 24 | -------------------------------------------------------------------------------- /demo/northwind-traders/admin/clear-ontologies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$(realpath "$2")" 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | clear-ontology.sh \ 21 | -f "$cert_pem_file" \ 22 | -p "$cert_password" \ 23 | -b "${base}admin/" \ 24 | --proxy "$proxy" \ 25 | --ontology "${base}ns#" 26 | -------------------------------------------------------------------------------- /demo/northwind-traders/admin/model/add-imports.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/demo/northwind-traders/ ../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | add-ontology-import.sh \ 21 | -f "$cert_pem_file" \ 22 | -p "$cert_password" \ 23 | --proxy "$proxy" \ 24 | --import "https://schema.org/" \ 25 | "${base}admin/ontologies/namespace/" 26 | -------------------------------------------------------------------------------- /demo/northwind-traders/admin/model/import-ontologies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/demo/northwind-traders/ ../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | pwd=$(realpath "$PWD") 21 | 22 | printf "\n### Creating ontology item\n\n" 23 | 24 | ont_doc=$(create-item.sh \ 25 | -b "${base}admin/" \ 26 | -f "$cert_pem_file" \ 27 | -p "$cert_password" \ 28 | --proxy "$proxy" \ 29 | --title "Northwind Traders" \ 30 | --slug "northwind-traders" \ 31 | --container "${base}admin/ontologies/" 32 | ) 33 | 34 | printf "\n### Appending ontology document\n\n" 35 | 36 | cat "$pwd"/northwind-traders.ttl | turtle --base="$ont_doc" | post.sh \ 37 | -f "$cert_pem_file" \ 38 | -p "$cert_password" \ 39 | --proxy "$proxy" \ 40 | -t "application/n-triples" \ 41 | "$ont_doc" 42 | -------------------------------------------------------------------------------- /demo/northwind-traders/admin/model/northwind-traders.ttl: -------------------------------------------------------------------------------- 1 | @prefix : . 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix xsd: . 5 | @prefix owl: . 6 | @prefix dh: . 7 | @prefix sioc: . 8 | @prefix foaf: . 9 | @prefix dct: . 10 | 11 | : a owl:Ontology . 12 | 13 | # classes 14 | 15 | :Person a owl:Class ; 16 | rdfs:label "Person" ; 17 | rdfs:isDefinedBy : . 18 | 19 | :Order a owl:Class ; 20 | rdfs:label "Order" ; 21 | rdfs:isDefinedBy : . 22 | 23 | :City a owl:Class ; 24 | rdfs:label "City" ; 25 | rdfs:isDefinedBy : . 26 | 27 | :PostalAddress a owl:Class ; 28 | rdfs:label "Postal address" ; 29 | rdfs:isDefinedBy : . 30 | 31 | # properties 32 | 33 | :broker a owl:ObjectProperty ; 34 | rdfs:label "Broker"; 35 | rdfs:domain :Order ; 36 | rdfs:range :Person ; 37 | rdfs:isDefinedBy : . 38 | 39 | :areaServed a owl:ObjectProperty ; 40 | rdfs:label "Area served"; 41 | rdfs:domain :Person ; 42 | rdfs:range :City ; 43 | rdfs:isDefinedBy : . 44 | 45 | :address a owl:ObjectProperty ; 46 | rdfs:label "Address"; 47 | rdfs:domain :Person ; 48 | rdfs:range :PostalAddress ; 49 | rdfs:isDefinedBy : . 50 | 51 | # restrictions 52 | 53 | [] a owl:Restriction ; 54 | owl:onProperty :broker ; 55 | owl:minCardinality 1 ; 56 | owl:maxCardinality 1 ; 57 | rdfs:isDefinedBy : . 58 | 59 | [] a owl:Restriction ; 60 | owl:onProperty :address ; 61 | owl:minCardinality 1 ; 62 | owl:maxCardinality 1 ; 63 | rdfs:isDefinedBy : . 64 | 65 | # blocks 66 | 67 | @prefix ldh: . 68 | @prefix sp: . 69 | @prefix spin: . 70 | 71 | :Person ldh:template <#content-76b5d972-86e8-424b-83fb-d0d7abe3bb75> . 72 | 73 | <#content-76b5d972-86e8-424b-83fb-d0d7abe3bb75> a ldh:View ; 74 | rdfs:label "Orders handled by this employee" ; 75 | spin:query <#query-53e279eb-3c8c-42bd-8a81-fea183d2be01> . 76 | 77 | <#query-53e279eb-3c8c-42bd-8a81-fea183d2be01> a sp:Select ; 78 | sp:text "SELECT DISTINCT ?instance { GRAPH ?g { ?instance $this } }" . -------------------------------------------------------------------------------- /demo/northwind-traders/create-charts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | pwd=$(realpath "$PWD") 21 | 22 | # top selling products 23 | 24 | query_doc=$(create-item.sh \ 25 | -b "$base" \ 26 | -f "$cert_pem_file" \ 27 | -p "$cert_password" \ 28 | --proxy "$proxy" \ 29 | --title "Products by sales" \ 30 | --slug "products-by-sales" \ 31 | --container "${base}queries/" 32 | ) 33 | 34 | query_id="this" 35 | 36 | add-select.sh \ 37 | -b "$base" \ 38 | -f "$cert_pem_file" \ 39 | -p "$cert_password" \ 40 | --proxy "$proxy" \ 41 | --title "Products by sales" \ 42 | --fragment "$query_id" \ 43 | --query-file "${pwd}/queries/charts/select-products-by-sales.rq" \ 44 | "$query_doc" 45 | 46 | chart_doc=$(create-item.sh \ 47 | -b "$base" \ 48 | -f "$cert_pem_file" \ 49 | -p "$cert_password" \ 50 | --proxy "$proxy" \ 51 | --title "Top selling products" \ 52 | --slug "top-selling-products" \ 53 | --container "${base}charts/" 54 | ) 55 | 56 | add-result-set-chart.sh \ 57 | -b "$base" \ 58 | -f "$cert_pem_file" \ 59 | -p "$cert_password" \ 60 | --proxy "$proxy" \ 61 | --title "Top selling products" \ 62 | --fragment this \ 63 | --query "${query_doc}#${query_id}" \ 64 | --chart-type "https://w3id.org/atomgraph/client#BarChart" \ 65 | --category-var-name "productName" \ 66 | --series-var-name "totalSales" \ 67 | "$chart_doc" 68 | 69 | # sales by region per year 70 | 71 | query_doc=$(create-item.sh \ 72 | -b "$base" \ 73 | -f "$cert_pem_file" \ 74 | -p "$cert_password" \ 75 | --proxy "$proxy" \ 76 | --title "Sales by region per year" \ 77 | --slug "sales-by-region-per-year" \ 78 | --container "${base}queries/" 79 | ) 80 | 81 | query_id="sales-by-regions-by-year" 82 | 83 | add-select.sh \ 84 | -b "$base" \ 85 | -f "$cert_pem_file" \ 86 | -p "$cert_password" \ 87 | --proxy "$proxy" \ 88 | --title "Sales by region per year" \ 89 | --fragment "$query_id" \ 90 | --query-file "${pwd}/queries/charts/select-sales-by-regions-by-year.rq" \ 91 | "$query_doc" 92 | 93 | chart_doc=$(create-item.sh \ 94 | -b "$base" \ 95 | -f "$cert_pem_file" \ 96 | -p "$cert_password" \ 97 | --proxy "$proxy" \ 98 | --title "Sales by region per year" \ 99 | --slug "sales-by-regions-by-year" \ 100 | --container "${base}charts/" 101 | ) 102 | 103 | add-result-set-chart.sh \ 104 | -b "$base" \ 105 | -f "$cert_pem_file" \ 106 | -p "$cert_password" \ 107 | --proxy "$proxy" \ 108 | --title "Sales by region per year" \ 109 | --fragment this \ 110 | --query "${query_doc}#${query_id}" \ 111 | --chart-type "https://w3id.org/atomgraph/client#Table" \ 112 | --category-var-name "year" \ 113 | --series-var-name "regionName" \ 114 | --series-var-name "totalSales" \ 115 | "$chart_doc" 116 | -------------------------------------------------------------------------------- /demo/northwind-traders/csv2rdf.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 1 ]; then 4 | echo "Usage: $0" '$base' >&2 5 | echo "Example: $0" 'https://localhost:4443/' >&2 6 | exit 1 7 | fi 8 | 9 | base="$1" 10 | 11 | cat ./files/categories.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/categories.rq":/tmp/categories.rq atomgraph/csv2rdf /tmp/categories.rq "$base" > ./files/categories.nt 12 | 13 | cat ./files/customers.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/customers.rq":/tmp/customers.rq atomgraph/csv2rdf /tmp/customers.rq "$base" > ./files/customers.nt 14 | 15 | cat ./files/employee_territories.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/employee_territories.rq":/tmp/employee_territories.rq atomgraph/csv2rdf /tmp/employee_territories.rq "$base" > ./files/employee_territories.nt 16 | 17 | cat ./files/employees.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/employees.rq":/tmp/employees.rq atomgraph/csv2rdf /tmp/employees.rq "$base" > ./files/employees.nt 18 | 19 | cat ./files/order_details.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/order_details.rq":/tmp/order_details.rq atomgraph/csv2rdf /tmp/order_details.rq "$base" > ./files/order_details.nt 20 | 21 | cat ./files/orders.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/orders.rq":/tmp/orders.rq atomgraph/csv2rdf /tmp/orders.rq "$base" > ./files/orders.nt 22 | 23 | cat ./files/products.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/products.rq":/tmp/products.rq atomgraph/csv2rdf /tmp/products.rq "$base" > ./files/products.nt 24 | 25 | cat ./files/regions.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/regions.rq":/tmp/regions.rq atomgraph/csv2rdf /tmp/regions.rq "$base" > ./files/regions.nt 26 | 27 | cat ./files/shippers.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/shippers.rq":/tmp/shippers.rq atomgraph/csv2rdf /tmp/shippers.rq "$base" > ./files/shippers.nt 28 | 29 | cat ./files/suppliers.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/suppliers.rq":/tmp/suppliers.rq atomgraph/csv2rdf /tmp/suppliers.rq "$base" > ./files/suppliers.nt 30 | 31 | cat ./files/territories.csv | docker run -i -a stdin -a stdout -a stderr -v "$(pwd)/queries/imports/territories.rq":/tmp/territories.rq atomgraph/csv2rdf /tmp/territories.rq "$base" > ./files/territories.nt -------------------------------------------------------------------------------- /demo/northwind-traders/files/categories.csv: -------------------------------------------------------------------------------- 1 | categoryID,categoryName,description,pictureHash 2 | 1,Beverages,Soft drinks coffees teas beers and ales,5e1be0328ca2c694d1de6f5b1b3d3b1ce90cb41f 3 | 2,Condiments,Sweet and savory sauces relishes spreads and seasonings,6e5d9df213a6c46b4f75e9ba2e321436f80d8bed 4 | 3,Confections,Desserts candies and sweet breads,c158852927adca461b57d6a1db332eaa38ff35e6 5 | 4,Dairy Products,Cheeses,3e612531a9a160b12c3db6565a2b03c0e8617ed3 6 | 5,Grains/Cereals,Breads crackers pasta and cereal,68ccbb7d6dbd511b9d5faf1f0d1c09c2872d8081 7 | 6,Meat/Poultry,Prepared meats,7e12f6c6f5202018e380c58262b654b800e1b250 8 | 7,Produce,Dried fruit and bean curd,1474abcca6dc8c27c20edc2d5f70a14db8c7513d 9 | 8,Seafood,Seaweed and fish,ff84beb4a82d5186fa3b80ce84ce095721093e69 -------------------------------------------------------------------------------- /demo/northwind-traders/files/employee_territories.csv: -------------------------------------------------------------------------------- 1 | employeeID,territoryID 2 | 1,06897 3 | 1,19713 4 | 2,01581 5 | 2,01730 6 | 2,01833 7 | 2,02116 8 | 2,02139 9 | 2,02184 10 | 2,40222 11 | 3,30346 12 | 3,31406 13 | 3,32859 14 | 3,33607 15 | 4,20852 16 | 4,27403 17 | 4,27511 18 | 5,02903 19 | 5,07960 20 | 5,08837 21 | 5,10019 22 | 5,10038 23 | 5,11747 24 | 5,14450 25 | 6,85014 26 | 6,85251 27 | 6,98004 28 | 6,98052 29 | 6,98104 30 | 7,60179 31 | 7,60601 32 | 7,80202 33 | 7,80909 34 | 7,90405 35 | 7,94025 36 | 7,94105 37 | 7,95008 38 | 7,95054 39 | 7,95060 40 | 8,19428 41 | 8,44122 42 | 8,45839 43 | 8,53404 44 | 9,03049 45 | 9,03801 46 | 9,48075 47 | 9,48084 48 | 9,48304 49 | 9,55113 50 | 9,55439 51 | -------------------------------------------------------------------------------- /demo/northwind-traders/files/employees.csv: -------------------------------------------------------------------------------- 1 | employeeID,lastName,firstName,title,titleOfCourtesy,birthDate,hireDate,address,city,region,postalCode,country,homePhone,extension,notes,reportsTo,photoHash,lat,long 2 | 1,Davolio,Nancy,Sales Representative,Ms.,1948-12-08 0:00:00,1992-05-01 0:00:00,507 20th Ave. E. Apt. 2A,Seattle,WA,98122,USA,(206) 555-9857,5467,Education includes a BA in psychology from Colorado State University in 1970. She also completed The Art of the Cold Call. Nancy is a member of Toastmasters International.,2,fb2e87988887cebf252947ba5d98e34d01d44ed4,47.6196755,-122.3060816 3 | 2,Fuller,Andrew,Vice President Sales,Dr.,1952-02-19 0:00:00,1992-08-14 0:00:00,908 W. Capital Way,Tacoma,WA,98401,USA,(206) 555-9482,3457,Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981. He is fluent in French and Italian and reads German. He joined the company as a sales representative was promoted to sales manager,,2e01d9bd3252b4d3a18269b8a7144a5ac53a8eea,47.253671,-122.444335 4 | 3,Leverling,Janet,Sales Representative,Ms.,1963-08-30 0:00:00,1992-04-01 0:00:00,722 Moss Bay Blvd.,Kirkland,WA,98033,USA,(206) 555-3412,3355,Janet has a BS degree in chemistry from Boston College (1984). She has also completed a certificate program in food retailing management. Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992.,2,56c3bf02eb71dc6039b3d88cd48064765e7e9a2e,47.6859573,-122.1920249 5 | 4,Peacock,Margaret,Sales Representative,Mrs.,1937-09-19 0:00:00,1993-05-03 0:00:00,4110 Old Redmond Rd.,Redmond,WA,98052,USA,(206) 555-8122,5176,Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966). She was assigned to the London office temporarily from July through November 1992.,2,e7c6d342fda288dbf1a2ebfdad8423b618c3a4ec,47.6719476,-122.1335668 6 | 5,Buchanan,Steven,Sales Manager,Mr.,1955-03-04 0:00:00,1993-10-17 0:00:00,14 Garrett Hill,London,,SW1 8JR,UK,(71) 555-4848,3453,Steven Buchanan graduated from St. Andrews University in Scotland with a BSC degree in 1976. Upon joining the company as a sales representative in 1992 he spent 6 months in an orientation program at the Seattle office.,2,71d6faa8ce45949526ca2317a78b87567bb6721f,51.5073219,-0.1276474 7 | 6,Suyama,Michael,Sales Representative,Mr.,1963-07-02 0:00:00,1993-10-17 0:00:00,Coventry House Miner Rd.,London,,EC2 7JR,UK,(71) 555-7773,428,Michael is a graduate of Sussex University (MA Economics 1983) and the University of California at Los Angeles (MBA marketing 1986). He has also taken the courses Multi-Cultural Selling and Time Management for the Sales Professional.,5,cb8b0702d0e1c948bebb1377dffca3787147890e,51.5225,-0.0857 8 | 7,King,Robert,Sales Representative,Mr.,1960-05-29 0:00:00,1994-01-02 0:00:00,Edgeham Hollow Winchester Way,London,,RG1 9SP,UK,(71) 555-5598,465,Robert King served in the Peace Corps and traveled extensively before completing his degree in English at the University of Michigan in 1992 the year he joined the company.,5,bcc47ec0ed5ef773f48af4ba47a1461784651a45,51.453506,-0.976976 9 | 8,Callahan,Laura,Inside Sales Coordinator,Ms.,1958-01-09 0:00:00,1994-03-05 0:00:00,4726 11th Ave. N.E.,Seattle,WA,98105,USA,(206) 555-1189,2344,Laura received a BA in psychology from the University of Washington. She has also completed a course in business French. She reads and writes French.,2,3e093b6c95ea749c6086600b54331a519d555307,47.6631746,-122.3706467 10 | 9,Dodsworth,Anne,Sales Representative,Ms.,1966-01-27 0:00:00,1994-11-15 0:00:00,7 Houndstooth Rd.,London,,WG2 7LT,UK,(71) 555-4444,452,Anne has a BA degree in English from St. Lawrence College. She is fluent in French and German.,5,adc69ff7f1e985655a37f818400e45d905aaef8a,51.5073219,-0.1276474 -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/beverages.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/beverages.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/cereals.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/cereals.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/condiments.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/condiments.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/confections.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/confections.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/diary.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/diary.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/meat.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/meat.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/produce.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/produce.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/categories/seafood.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/categories/seafood.gif -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/andrew.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/andrew.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/anne.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/anne.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/janet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/janet.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/laura.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/laura.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/margaret.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/margaret.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/michael.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/michael.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/nancy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/nancy.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/robert.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/robert.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/images/employees/steven.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/files/images/employees/steven.jpg -------------------------------------------------------------------------------- /demo/northwind-traders/files/regions.csv: -------------------------------------------------------------------------------- 1 | regionID,regionDescription 2 | 1,Eastern 3 | 2,Western 4 | 3,Northern 5 | 4,Southern 6 | -------------------------------------------------------------------------------- /demo/northwind-traders/files/shippers.csv: -------------------------------------------------------------------------------- 1 | shipperID,companyName,phone 2 | 1,Speedy Express,(503) 555-9831 3 | 2,United Package,(503) 555-3199 4 | 3,Federal Shipping,(503) 555-9931 5 | -------------------------------------------------------------------------------- /demo/northwind-traders/files/suppliers.csv: -------------------------------------------------------------------------------- 1 | supplierID,companyName,contactName,contactTitle,address,city,region,postalCode,country,phone,fax,homePage,lat,long 2 | 1,Exotic Liquids,Charlotte Cooper,Purchasing Manager,49 Gilbert St.,London,,EC1 4SD,UK,(171) 555-2222,,,51.5232,-0.1055 3 | 2,New Orleans Cajun Delights,Shelley Burke,Order Administrator,P.O. Box 78934,New Orleans,LA,70117,USA,(100) 555-4822,,#CAJUN.HTM#,29.9499323,-90.0701156 4 | 3,Grandma Kelly's Homestead,Regina Murphy,Sales Representative,707 Oxford Rd.,Ann Arbor,MI,48104,USA,(313) 555-5735,(313) 555-3349,,42.2730379,-83.725509 5 | 4,Tokyo Traders,Yoshi Nagase,Marketing Manager,9-8 Sekimai Musashino-shi,Tokyo,,100,Japan,(03) 3555-5011,,,35.71771,139.566 6 | 5,Cooperativa de Quesos 'Las Cabras',Antonio del Valle Saavedra,Export Administrator,Calle del Rosal 4,Oviedo,Asturias,33007,Spain,(98) 598 76 54,,,43.3603,-5.8448 7 | 6,Mayumi's,Mayumi Ohno,Marketing Representative,92 Setsuko Chuo-ku,Osaka,,545,Japan,(06) 431-7877,,Mayumi's (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/mayumi.htm#,34.679846,135.510316 8 | 7,Pavlova Ltd.,Ian Devling,Marketing Manager,74 Rose St. Moonie Ponds,Melbourne,Victoria,3058,Australia,(03) 444-2343,(03) 444-6588,,-37.7418748,144.947579 9 | 8,Specialty Biscuits Ltd.,Peter Wilson,Sales Representative,29 King's Way,Manchester,,M14 GSD,UK,(161) 555-4448,,,53.4482,-2.2257 10 | 9,PB Knäckebröd AB,Lars Peterson,Sales Agent,Kaloadagatan 13,Göteborg,,S-345 67,Sweden,031-987 65 43,031-987 65 91,,57.7072326,11.9670171 11 | 10,Refrescos Americanas LTDA,Carlos Diaz,Marketing Manager,Av. das Americanas 12.890,Sao Paulo,,5442,Brazil,(11) 555 4640,,,-23.5296993,-46.7777714 12 | 11,Heli Süßwaren GmbH & Co. KG,Petra Winkler,Sales Manager,Tiergartenstraße 5,Berlin,,10785,Germany,(010) 9984510,,,52.5099916,13.3643875 13 | 12,Plutzer Lebensmittelgroßmärkte AG,Martin Bein,International Marketing Mgr.,Bogenallee 51,Frankfurt,,60439,Germany,(069) 992755,,Plutzer (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/plutzer.htm#,50.1106444,8.6820917 14 | 13,Nord-Ost-Fisch Handelsgesellschaft mbH,Sven Petersen,Coordinator Foreign Markets,Frahmredder 112a,Cuxhaven,,27478,Germany,(04721) 8713,(04721) 8714,,53.86878,8.698286 15 | 14,Formaggi Fortini s.r.l.,Elio Rossi,Sales Representative,Viale Dante 75,Ravenna,,48100,Italy,(0544) 60323,(0544) 60603,#FORMAGGI.HTM#,44.4474603,12.0508594 16 | 15,Norske Meierier,Beate Vileid,Marketing Manager,Hatlevegen 5,Sandvika,,1320,Norway,(0)2-953010,,,59.1787087,10.9063133 17 | 16,Bigfoot Breweries,Cheryl Saylor,Regional Account Rep.,3400 - 8th Avenue Suite 210,Bend,OR,97101,USA,(503) 555-9931,,,44.0581728,-121.3153096 18 | 17,Svensk Sjöföda AB,Michael Björn,Sales Representative,Brovallavägen 231,Stockholm,,S-123 45,Sweden,08-123 45 67,,,59.3251172,18.0710935 19 | 18,Aux joyeux ecclésiastiques,Guylène Nodier,Sales Manager,203 Rue des Francs-Bourgeois,Paris,,75004,France,(1) 03.83.00.68,(1) 03.83.00.62,,48.8564104,2.3644567 20 | 19,New England Seafood Cannery,Robb Merchant,Wholesale Account Agent,Order Processing Dept. 2100 Paul Revere Blvd.,Boston,MA,02134,USA,(617) 555-3267,(617) 555-3389,,42.3602534,-71.0582912 21 | 20,Leka Trading,Chandra Leka,Owner,471 Serangoon Loop Suite #402,Singapore,,0512,Singapore,555-8787,,,1.3497611,103.8736841 22 | 21,Lyngbysild,Niels Petersen,Sales Manager,Lyngbysild Fiskebakken 10,Lyngby,,2800,Denmark,43844108,43844115,,55.7718649,12.5051413 23 | 22,Zaanse Snoepfabriek,Dirk Luchte,Accounting Manager,Verkoop Rijnweg 22,Zaandam,,9999 ZZ,Netherlands,(12345) 1212,(12345) 1210,,, 24 | 23,Karkki Oy,Anne Heikkonen,Product Manager,Valtakatu 12,Lappeenranta,,53120,Finland,(953) 10956,,,61.0576561,28.1762109 25 | 24,G'day Mate,Wendy Mackenzie,Sales Representative,170 Prince Edward Parade Hunter's Hill,Sydney,NSW,2042,Australia,(02) 555-5914,(02) 555-4873,G'day Mate (on the World Wide Web)#http://www.microsoft.com/accessdev/sampleapps/gdaymate.htm#,-33.8408126,151.1644137 26 | 25,Ma Maison,Jean-Guy Lauzon,Marketing Manager,2960 Rue St. Laurent,Montréal,Québec,H1J 1C3,Canada,(514) 555-9022,,,45.611003,-73.572026 27 | 26,Pasta Buttini s.r.l.,Giovanni Giudici,Order Administrator,Via dei Gelsomini 153,Salerno,,84100,Italy,(089) 6547665,(089) 6547667,,40.6803601,14.7594542 28 | 27,Escargots Nouveaux,Marie Delamare,Sales Manager,22 rue H. Voiron,Montceau,,71300,France,85.57.00.07,,,46.677782,4.3753949 29 | 28,Gai pâturage,Eliane Noz,Sales Representative,Bat. B 3 rue des Alpes,Annecy,,74000,France,38.76.98.06,38.76.98.58,,45.9,6.1167 30 | 29,Forêts d'érables,Chantal Goulet,Accounting Manager,148 rue Chasseur,Ste-Hyacinthe,Québec,J2S 7S8,Canada,(514) 555-2955,(514) 555-2921,,45.628565,-72.978652 31 | -------------------------------------------------------------------------------- /demo/northwind-traders/files/territories.csv: -------------------------------------------------------------------------------- 1 | territoryID,territoryDescription,regionID 2 | 01581,Westboro,1 3 | 01730,Bedford,1 4 | 01833,Georgetown,1 5 | 02116,Boston,1 6 | 02139,Cambridge,1 7 | 02184,Braintree,1 8 | 02903,Providence,1 9 | 03049,Hollis,3 10 | 03801,Portsmouth,3 11 | 06897,Wilton,1 12 | 07960,Morristown,1 13 | 08837,Edison,1 14 | 10019,New York,1 15 | 10038,New York,1 16 | 11747,Mellvile,1 17 | 14450,Fairport,1 18 | 19428,Philadelphia,3 19 | 19713,Neward,1 20 | 20852,Rockville,1 21 | 27403,Greensboro,1 22 | 27511,Cary,1 23 | 29202,Columbia,4 24 | 30346,Atlanta,4 25 | 31406,Savannah,4 26 | 32859,Orlando,4 27 | 33607,Tampa,4 28 | 40222,Louisville,1 29 | 44122,Beachwood,3 30 | 45839,Findlay,3 31 | 48075,Southfield,3 32 | 48084,Troy,3 33 | 48304,Bloomfield Hills,3 34 | 53404,Racine,3 35 | 55113,Roseville,3 36 | 55439,Minneapolis,3 37 | 60179,Hoffman Estates,2 38 | 60601,Chicago,2 39 | 72716,Bentonville,4 40 | 75234,Dallas,4 41 | 78759,Austin,4 42 | 80202,Denver,2 43 | 80909,Colorado Springs,2 44 | 85014,Phoenix,2 45 | 85251,Scottsdale,2 46 | 90405,Santa Monica,2 47 | 94025,Menlo Park,2 48 | 94105,San Francisco,2 49 | 95008,Campbell,2 50 | 95054,Santa Clara,2 51 | 95060,Santa Cruz,2 52 | 98004,Bellevue,2 53 | 98052,Redmond,2 54 | 98104,Seattle,2 55 | -------------------------------------------------------------------------------- /demo/northwind-traders/import-csv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | imports_csv="$(dirname "$(realpath "$0")")/imports.csv" 14 | 15 | if [ -n "$4" ]; then 16 | proxy="$4" 17 | else 18 | proxy="$base" 19 | fi 20 | 21 | titles=() 22 | queries=() 23 | files=() 24 | 25 | pwd=$(realpath "$PWD") 26 | 27 | arr_csv=() 28 | while IFS= read -r line 29 | do 30 | arr_csv+=("$line") 31 | done < <(tail -n +2 "$imports_csv") 32 | 33 | index=0 34 | for row in "${arr_csv[@]}" 35 | do 36 | query_filename=$(echo "$row" | cut -d "," -f 1) 37 | csv_filename=$(echo "$row" | cut -d "," -f 2) 38 | title=$(echo "$row" | cut -d "," -f 3) 39 | 40 | titles+=("$title") 41 | 42 | # create query 43 | 44 | query_doc=$(create-query.sh \ 45 | -b "$base" \ 46 | -f "$cert_pem_file" \ 47 | -p "$cert_password" \ 48 | --proxy "$proxy" \ 49 | --title "$title" \ 50 | --query-file "$pwd/${query_filename}") 51 | 52 | query_ntriples=$(get.sh \ 53 | -f "$cert_pem_file" \ 54 | -p "$cert_password" \ 55 | --proxy "$proxy" \ 56 | --accept 'application/n-triples' \ 57 | "$query_doc") 58 | 59 | query=$(echo "$query_ntriples" | sed -rn "s/<${query_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 60 | queries+=("$query") 61 | 62 | # upload file 63 | 64 | file_doc=$(create-file.sh \ 65 | -b "$base" \ 66 | -f "$cert_pem_file" \ 67 | -p "$cert_password" \ 68 | --proxy "$proxy" \ 69 | --title "$title" \ 70 | --file "$pwd/${csv_filename}" \ 71 | --file-content-type "text/csv") 72 | 73 | file_ntriples=$(get.sh \ 74 | -f "$cert_pem_file" \ 75 | -p "$cert_password" \ 76 | --proxy "$proxy" \ 77 | --accept 'application/n-triples' \ 78 | "$file_doc") 79 | 80 | file=$(echo "$file_ntriples" | sed -rn "s/<${file_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 81 | files+=("$file") 82 | 83 | # iterate 84 | 85 | ((index++)) 86 | done 87 | 88 | # start imports - postpone until after documents are created so we don't get concurrent updates to the triplestore 89 | 90 | for i in "${!files[@]}"; do 91 | printf "\n### Importing CSV from %s\n\n" "${files[$i]}" 92 | 93 | create-csv-import.sh \ 94 | -b "$base" \ 95 | -f "$cert_pem_file" \ 96 | -p "$cert_password" \ 97 | --proxy "$proxy" \ 98 | --title "${titles[$i]}" \ 99 | --query "${queries[$i]}" \ 100 | --file "${files[$i]}" \ 101 | --delimiter "," 102 | done 103 | -------------------------------------------------------------------------------- /demo/northwind-traders/imports.csv: -------------------------------------------------------------------------------- 1 | query_filename,csv_filename,title 2 | queries/imports/categories.rq,files/categories.csv,Categories 3 | queries/imports/customers.rq,files/customers.csv,Customers 4 | queries/imports/employees.rq,files/employees.csv,Employees 5 | queries/imports/employee_territories.rq,files/employee_territories.csv,Employee territories 6 | queries/imports/orders.rq,files/orders.csv,Orders 7 | queries/imports/order_details.rq,files/order_details.csv,Order details 8 | queries/imports/products.rq,files/products.csv,Products 9 | queries/imports/regions.rq,files/regions.csv,Regions 10 | queries/imports/shippers.rq,files/shippers.csv,Shippers 11 | queries/imports/suppliers.rq,files/suppliers.csv,Suppliers 12 | queries/imports/territories.rq,files/territories.csv,Territories 13 | -------------------------------------------------------------------------------- /demo/northwind-traders/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | pwd="$(realpath "$PWD")" 21 | 22 | printf "\n### Creating authorization to make the app public\n\n" 23 | 24 | make-public.sh -b "$base" -f "$cert_pem_file" -p "$cert_password" --proxy "$proxy" 25 | 26 | cd admin/model 27 | 28 | printf "\n### Import ontologies\n\n" 29 | 30 | ./import-ontologies.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 31 | 32 | printf "\n### Adding ontology import\n\n" 33 | 34 | ./add-imports.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 35 | 36 | printf "\n### Clearing ontologies\n\n" 37 | 38 | cd .. 39 | 40 | ./clear-ontologies.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 41 | 42 | cd .. 43 | 44 | printf "\n### Creating containers\n\n" 45 | 46 | ./create-containers.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 47 | 48 | printf "\n### Updating documents\n\n" 49 | 50 | ./update-documents.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 51 | 52 | printf "\n### Creating charts\n\n" 53 | 54 | ./create-charts.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 55 | 56 | printf "\n### Uploading files\n\n" 57 | 58 | find "${pwd}/files/images/categories" -type f -exec ./upload-file.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" {} "$proxy" \; 59 | 60 | find "${pwd}/files/images/employees" -type f -exec ./upload-file.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" {} "$proxy" \; 61 | 62 | printf "\n### Importing CSV data\n\n" 63 | 64 | ./import-csv.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" -------------------------------------------------------------------------------- /demo/northwind-traders/queries/charts/select-products-by-sales.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?productName (SUM(?sale) AS ?totalSales) 4 | WHERE 5 | { GRAPH ?orderGraph 6 | { ?order schema:orderedItem ?orderItem . 7 | ?orderItem schema:orderedItem ?product ; 8 | schema:orderQuantity ?quantity ; 9 | schema:price ?price 10 | BIND (?quantity * ?price AS ?sale) 11 | } 12 | GRAPH ?productGraph 13 | { ?product schema:name ?productName } 14 | } 15 | GROUP BY ?product ?productName 16 | ORDER BY DESC(?totalSales) 17 | LIMIT 5 -------------------------------------------------------------------------------- /demo/northwind-traders/queries/charts/select-sales-by-regions-by-year.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | PREFIX xsd: 3 | 4 | SELECT DISTINCT ?year ?regionName (SUM(?sale) AS ?totalSales) 5 | WHERE 6 | { GRAPH ?orderGraph 7 | { ?order schema:orderDate ?orderDate ; 8 | schema:broker ?employee ; 9 | schema:orderedItem ?orderItem 10 | BIND(year(xsd:dateTime(?orderDate)) AS ?year) 11 | ?orderItem schema:orderedItem ?product ; 12 | schema:orderQuantity ?quantity ; 13 | schema:price ?price 14 | BIND(( ?quantity * ?price ) AS ?sale) 15 | } 16 | GRAPH ?employeeGraph 17 | { ?employee schema:areaServed ?territory } 18 | GRAPH ?territoryGraph 19 | { ?territory schema:containedInPlace ?region } 20 | GRAPH ?regionGraph 21 | { ?region schema:name ?regionName } 22 | } 23 | GROUP BY ?year ?regionName 24 | ORDER BY DESC(?year) ?regionName 25 | LIMIT 100 -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/categories.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | 5 | CONSTRUCT 6 | { 7 | GRAPH ?graph 8 | { 9 | ?graph dct:title ?categoryName ; 10 | foaf:primaryTopic ?category . 11 | 12 | ?category a schema:ProductGroup ; 13 | dct:title ?categoryName ; 14 | dct:description ?description ; 15 | schema:name ?categoryName ; 16 | schema:identifier ?categoryID ; 17 | schema:description ?description ; 18 | foaf:depiction ?picture . 19 | } 20 | } 21 | WHERE 22 | { 23 | ?category_row <#categoryID> ?categoryID ; 24 | <#description> ?description ; 25 | <#categoryName> ?categoryName ; 26 | <#pictureHash> ?pictureHash . 27 | 28 | BIND(uri(concat(str($base), "categories/")) AS ?container) 29 | BIND(uri(concat(str(?container), encode_for_uri(?categoryID), "/")) AS ?graph) 30 | BIND(uri(concat(str(?graph), "#this")) AS ?category) 31 | BIND(uri(concat(str($base), "uploads/", encode_for_uri(?pictureHash))) AS ?picture) 32 | } 33 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/customers.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | PREFIX xsd: 5 | PREFIX geo: 6 | 7 | CONSTRUCT 8 | { 9 | GRAPH ?graph 10 | { 11 | ?graph dct:title ?companyName ; 12 | foaf:primaryTopic ?customer ; 13 | foaf:topic ?contactPoint, ?employee, ?postalAddress . 14 | 15 | ?customer a schema:Corporation ; 16 | schema:identifier ?customerID ; 17 | dct:title ?companyName ; 18 | schema:legalName ?companyName ; 19 | schema:contactPoint ?contactPoint ; 20 | schema:employee ?employee . 21 | 22 | ?contactPoint a schema:ContactPoint ; 23 | foaf:page ?graph ; 24 | schema:telephone ?phone ; 25 | schema:faxNumber ?fax . 26 | 27 | ?employee a schema:Person ; 28 | foaf:page ?graph ; 29 | schema:name ?contactName ; 30 | dct:title ?contactName ; 31 | schema:jobTitle ?contactTitle ; 32 | schema:telephone ?phone ; 33 | schema:faxNumber ?fax ; 34 | schema:address ?postalAddress ; 35 | geo:lat ?lat ; 36 | geo:long ?long . 37 | 38 | ?postalAddress a schema:PostalAddress ; 39 | foaf:page ?graph ; 40 | schema:addressCountry ?country ; 41 | schema:addressLocality ?city ; 42 | schema:postalCode ?postalCode ; 43 | schema:streetAddress ?address ; 44 | schema:addressRegion ?region . 45 | } 46 | } 47 | WHERE 48 | { 49 | ?customer_row <#customerID> ?customerID ; 50 | <#companyName> ?companyName ; 51 | <#contactName> ?contactName ; 52 | <#contactTitle> ?contactTitle ; 53 | <#address> ?address ; 54 | <#city> ?city ; 55 | <#postalCode> ?postalCode ; 56 | <#country> ?country ; 57 | <#phone> ?phone . 58 | 59 | OPTIONAL { 60 | ?customer_row <#region> ?region 61 | } 62 | OPTIONAL { 63 | ?customer_row <#fax> ?fax 64 | } 65 | OPTIONAL { 66 | ?customer_row <#lat> ?lat_string 67 | BIND(xsd:float(?lat_string) AS ?lat) 68 | } 69 | OPTIONAL { 70 | ?customer_row <#long> ?long_string 71 | BIND(xsd:float(?long_string) AS ?long) 72 | } 73 | 74 | BIND(uri(concat(str($base), "customers/")) AS ?container) 75 | BIND(uri(concat(str(?container), encode_for_uri(?customerID), "/")) AS ?graph) 76 | BIND(uri(concat(str(?graph), "#this")) AS ?customer) 77 | BIND(uri(concat(str(?graph), "#contact-point")) AS ?contactPoint) 78 | BIND(uri(concat(str(?graph), "#employee")) AS ?employee) 79 | BIND(uri(concat(str(?graph), "#postal-address")) AS ?postalAddress) 80 | } 81 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/employee_territories.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | CONSTRUCT 4 | { 5 | GRAPH ?graph 6 | { 7 | ?employee schema:areaServed ?territory 8 | } 9 | } 10 | WHERE 11 | { 12 | ?employee_territory <#employeeID> ?employeeID ; 13 | <#territoryID> ?territoryID . 14 | 15 | BIND(uri(concat(str($base), "employees/")) AS ?container) 16 | BIND(uri(concat(str(?container), encode_for_uri(?employeeID), "/")) AS ?graph) 17 | BIND(uri(concat(str(?graph), "#this")) AS ?employee) 18 | BIND(uri(concat(str($base), "territories/", encode_for_uri(?territoryID), "/#this")) AS ?territory) 19 | } 20 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/employees.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | PREFIX xsd: 5 | PREFIX geo: 6 | 7 | CONSTRUCT 8 | { 9 | GRAPH ?graph 10 | { 11 | ?graph dct:title ?lastName ; 12 | foaf:primaryTopic ?employee ; 13 | foaf:topic ?postalAddress . 14 | 15 | ?employee a schema:Person ; 16 | schema:identifier ?employeeID ; 17 | dct:title ?lastName ; 18 | dct:description ?title ; 19 | schema:givenName ?firstName ; 20 | schema:familyName ?lastName ; 21 | schema:jobTitle ?title ; 22 | schema:honorificPrefix ?titleOfCourtesy ; 23 | schema:birthDate ?birthDate; 24 | # ?hireDate 25 | schema:address ?postalAddress ; 26 | schema:telephone ?homePhone ; 27 | schema:telephone ?extension ; 28 | schema:description ?notes ; 29 | schema:sponsor ?reportsToEmployee ; 30 | geo:lat ?lat ; 31 | geo:long ?long ; 32 | foaf:img ?photo . 33 | 34 | ?postalAddress a schema:PostalAddress ; 35 | foaf:page ?graph ; 36 | schema:addressCountry ?country ; 37 | schema:addressLocality ?city ; 38 | schema:postalCode ?postalCode ; 39 | schema:streetAddress ?address ; 40 | schema:addressRegion ?region . 41 | } 42 | } 43 | WHERE 44 | { 45 | ?employee_row <#employeeID> ?employeeID ; 46 | <#lastName> ?lastName ; 47 | <#firstName> ?firstName ; 48 | <#title> ?title ; 49 | <#titleOfCourtesy> ?titleOfCourtesy ; 50 | <#birthDate> ?birthDateString ; 51 | <#hireDate> ?hireDateString ; 52 | <#address> ?address ; 53 | <#city> ?city ; 54 | <#postalCode> ?postalCode ; 55 | <#country> ?country ; 56 | <#homePhone> ?homePhone ; 57 | <#extension> ?extension ; 58 | <#photoHash> ?photoHash ; 59 | <#notes> ?notes ; 60 | <#lat> ?lat_string ; 61 | <#long> ?long_string . 62 | 63 | OPTIONAL { 64 | ?employee_row <#region> ?region 65 | } 66 | OPTIONAL { 67 | ?employee_row <#reportsTo> ?reportsTo 68 | BIND(uri(concat(str($base), "employees/", encode_for_uri(?reportsTo), "/#this")) AS ?reportsToEmployee) # cannot use ?container since it's undefined in the OPTIONAL scope 69 | } 70 | 71 | BIND(uri(concat(str($base), "employees/")) AS ?container) 72 | BIND(uri(concat(str(?container), encode_for_uri(?employeeID), "/")) AS ?graph) 73 | BIND(uri(concat(str(?graph), "#this")) AS ?employee) 74 | BIND(uri(concat(str(?graph), "#address")) AS ?postalAddress) 75 | BIND(xsd:float(?lat_string) AS ?lat) 76 | BIND(xsd:float(?long_string) AS ?long) 77 | BIND(strdt(substr(?birthDateString, 1, 10), xsd:date) AS ?birthDate) 78 | BIND(strdt(substr(?hireDateString, 1, 10), xsd:date) AS ?hireDate) 79 | BIND(uri(concat(str($base), "uploads/", encode_for_uri(?photoHash))) AS ?photo) 80 | } 81 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/order_details.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | PREFIX xsd: 5 | 6 | CONSTRUCT 7 | { 8 | GRAPH ?graph 9 | { 10 | ?order schema:orderedItem ?orderItem . 11 | 12 | ?orderItem a schema:OrderItem ; 13 | schema:orderedItem ?product ; 14 | schema:orderQuantity ?quantity ; 15 | schema:discount ?discount ; 16 | schema:price ?price . 17 | } 18 | } 19 | WHERE 20 | { 21 | ?order_detail_row <#orderID> ?orderID ; 22 | <#productID> ?productID ; 23 | <#unitPrice> ?unitPrice ; 24 | <#quantity> ?quantityString ; 25 | <#discount> ?discountString . 26 | 27 | BIND(uri(concat(str($base), "orders/", encode_for_uri(?orderID), "/")) AS ?graph) 28 | BIND(uri(concat(str(?graph), "#this")) AS ?order) 29 | BIND(uri(concat(str(?graph), "#", STRUUID())) AS ?orderItem) 30 | BIND(uri(concat(str($base), "products/", encode_for_uri(?productID), "/#this")) AS ?product) 31 | BIND (STRDT(?unitPrice, xsd:float) AS ?price) 32 | BIND (STRDT(?quantityString, xsd:integer) AS ?quantity) 33 | BIND (STRDT(?discountString, xsd:float) AS ?discount) 34 | } 35 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/orders.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | PREFIX xsd: 5 | 6 | CONSTRUCT 7 | { 8 | GRAPH ?graph 9 | { 10 | ?graph dct:title ?orderID ; 11 | foaf:primaryTopic ?order ; 12 | foaf:topic ?orderDelivery, ?deliveryAddress . 13 | 14 | ?order a schema:Order ; 15 | schema:identifier ?orderID ; 16 | dct:title ?orderID ; 17 | schema:customer ?customer ; 18 | schema:broker ?employee ; 19 | schema:orderDate ?orderDate ; 20 | schema:orderDelivery ?orderDelivery . 21 | 22 | ?orderDelivery a schema:ParcelDelivery ; 23 | foaf:page ?graph ; 24 | schema:expectedArrivalUntil ?requiredDate ; 25 | # ?shippedDate ; 26 | schema:deliveryAddress ?deliveryAddress ; 27 | schema:provider ?shipper . 28 | 29 | ?deliveryAddress a schema:PostalAddress ; 30 | foaf:page ?graph ; 31 | schema:addressCountry ?shipCountry ; 32 | schema:addressLocality ?shipCity ; 33 | schema:postalCode ?shipPostalCode ; 34 | schema:streetAddress ?shipAddress ; 35 | schema:location ?deliveryLocation ; 36 | schema:addressRegion ?shipRegion . 37 | } 38 | } 39 | WHERE 40 | { 41 | ?order_row <#orderID> ?orderID ; 42 | <#customerID> ?customerID ; 43 | <#employeeID> ?employeeID ; 44 | <#orderDate> ?orderDateString ; 45 | <#requiredDate> ?requiredDateString ; 46 | <#shipVia> ?shipVia ; 47 | <#freight> ?freightString ; 48 | <#shipName> ?shipName ; 49 | <#shipAddress> ?shipAddress ; 50 | <#shipCity> ?shipCity ; 51 | <#shipPostalCode> ?shipPostalCode ; 52 | <#shipCountry> ?shipCountry . 53 | 54 | OPTIONAL { 55 | ?order_row <#shippedDate> ?shippedDateString 56 | BIND(strdt(?shippedDateString, xsd:date) AS ?shippedDate) 57 | } 58 | OPTIONAL { 59 | ?order_row <#shipRegion> ?shipRegion 60 | } 61 | 62 | BIND(uri(concat(str($base), "orders/")) AS ?container) 63 | BIND(uri(concat(str(?container), encode_for_uri(?orderID), "/")) AS ?graph) 64 | BIND(uri(concat(str(?graph), "#this")) AS ?order) 65 | BIND(uri(concat(str(?graph), "#delivery")) AS ?orderDelivery) 66 | BIND(uri(concat(str(?graph), "#delivery-address")) AS ?deliveryAddress) 67 | BIND(uri(concat(str($base), "employees/", encode_for_uri(?employeeID), "/#this")) AS ?employee) 68 | BIND(uri(concat(str($base), "customers/", encode_for_uri(?customerID), "/#this")) AS ?customer) 69 | BIND(uri(concat(str($base), "shippers/", encode_for_uri(?shipVia), "/#this")) AS ?shipper) 70 | BIND(strdt(?orderDateString, xsd:date) AS ?orderDate) 71 | BIND(strdt(?requiredDateString, xsd:date) AS ?requiredDate) 72 | BIND(strdt(?freightString, xsd:float) AS ?freight) 73 | } 74 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/products.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | PREFIX xsd: 5 | 6 | CONSTRUCT 7 | { 8 | GRAPH ?graph 9 | { 10 | ?graph dct:title ?productName ; 11 | foaf:primaryTopic ?product . 12 | 13 | ?product a schema:Product ; 14 | schema:identifier ?productID ; 15 | dct:title ?productName ; 16 | schema:name ?productName ; 17 | schema:provider ?supplier ; 18 | schema:category ?category ; 19 | schema:description ?quantityPerUnit ; 20 | schema:price ?unitPrice . 21 | # ?unitsInStock ; 22 | # ?unitsOnOrder ; 23 | # ?reorderLevel ; 24 | # ?discontinued - schema:Discontinued 25 | } 26 | } 27 | WHERE 28 | { 29 | ?product_row <#productID> ?productID ; 30 | <#productName> ?productName ; 31 | <#supplierID> ?supplierID ; 32 | <#categoryID> ?categoryID ; 33 | <#quantityPerUnit> ?quantityPerUnit ; 34 | <#unitPrice> ?unitPriceString ; 35 | <#unitsInStock> ?unitsInStockString ; 36 | <#unitsOnOrder> ?unitsOnOrderString ; 37 | <#reorderLevel> ?reorderLevelString ; 38 | <#discontinued> ?discontinuedString . 39 | 40 | BIND (uri(concat(str($base), "products/")) AS ?container) 41 | BIND(uri(concat(str(?container), encode_for_uri(?productID), "/")) AS ?graph) 42 | BIND(uri(concat(str(?graph), "#this")) AS ?product) 43 | BIND(uri(concat(str($base), "suppliers/", encode_for_uri(?supplierID), "/#this")) AS ?supplier) 44 | BIND(uri(concat(str($base), "categories/", encode_for_uri(?categoryID), "/#this")) AS ?category) 45 | BIND (STRDT(?unitPriceString, xsd:float) AS ?unitPrice) 46 | BIND (STRDT(?unitsInStockString, xsd:integer) AS ?unitsInStock) 47 | BIND (STRDT(?unitsOnOrderString, xsd:integer) AS ?unitsOnOrder) 48 | BIND (STRDT(?reorderLevelString, xsd:integer) AS ?reorderLevel) 49 | BIND (STRDT(?discontinuedString, xsd:integer) AS ?discontinued) 50 | } -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/regions.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | 5 | CONSTRUCT 6 | { 7 | GRAPH ?graph 8 | { 9 | ?graph dct:title ?regionDescription ; 10 | foaf:primaryTopic ?region . 11 | 12 | ?region a schema:Place ; 13 | dct:title ?regionDescription ; 14 | schema:name ?regionDescription ; 15 | schema:identifier ?regionID . 16 | } 17 | } 18 | WHERE 19 | { 20 | ?region_row <#regionID> ?regionID ; 21 | <#regionDescription> ?regionDescription. 22 | 23 | BIND(uri(concat(str($base), "regions/")) AS ?container) 24 | BIND(uri(concat(str(?container), encode_for_uri(?regionID), "/")) AS ?graph) 25 | BIND(uri(concat(str(?graph), "#this")) AS ?region) 26 | } 27 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/shippers.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | 5 | CONSTRUCT 6 | { 7 | GRAPH ?graph 8 | { 9 | ?graph dct:title ?companyName ; 10 | foaf:primaryTopic ?shipper . 11 | 12 | ?shipper a schema:Corporation ; 13 | dct:title ?companyName ; 14 | schema:legalName ?companyName ; 15 | schema:identifier ?shipperID ; 16 | schema:telephone ?phone . 17 | } 18 | } 19 | WHERE 20 | { 21 | ?shipper_row <#shipperID> ?shipperID ; 22 | <#companyName> ?companyName ; 23 | <#phone> ?phone . 24 | 25 | BIND(uri(concat(str($base), "shippers/")) AS ?container) 26 | BIND(uri(concat(str(?container), encode_for_uri(?shipperID), "/")) AS ?graph) 27 | BIND(uri(concat(str(?graph), "#this")) AS ?shipper) 28 | } 29 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/suppliers.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | PREFIX xsd: 5 | PREFIX geo: 6 | 7 | CONSTRUCT 8 | { 9 | GRAPH ?graph 10 | { 11 | ?graph dct:title ?companyName ; 12 | foaf:primaryTopic ?supplier ; 13 | foaf:topic ?contactPoint, ?employee, ?postalAddress . 14 | 15 | ?supplier a schema:Corporation ; 16 | schema:identifier ?supplierID ; 17 | dct:title ?companyName ; 18 | schema:legalName ?companyName ; 19 | schema:contactPoint ?contactPoint ; 20 | schema:employee ?employee . 21 | 22 | ?contactPoint a schema:ContactPoint ; 23 | foaf:page ?graph ; 24 | schema:telephone ?phone ; 25 | schema:faxNumber ?fax ; 26 | schema:url ?homePage . 27 | 28 | ?employee a schema:Person ; 29 | foaf:page ?graph ; 30 | schema:name ?contactName ; 31 | dct:title ?contactName ; 32 | schema:jobTitle ?contactTitle ; 33 | schema:telephone ?phone ; 34 | schema:faxNumber ?fax ; 35 | schema:address ?postalAddress ; 36 | geo:lat ?lat ; 37 | geo:long ?long . 38 | 39 | ?postalAddress a schema:PostalAddress ; 40 | foaf:page ?graph ; 41 | schema:addressCountry ?country ; 42 | schema:addressLocality ?city ; 43 | schema:postalCode ?postalCode ; 44 | schema:streetAddress ?address ; 45 | schema:addressRegion ?region . 46 | } 47 | } 48 | WHERE 49 | { 50 | ?supplier_row <#supplierID> ?supplierID ; 51 | <#companyName> ?companyName ; 52 | <#contactName> ?contactName ; 53 | <#contactTitle> ?contactTitle ; 54 | <#address> ?address ; 55 | <#city> ?city ; 56 | <#postalCode> ?postalCode ; 57 | <#country> ?country ; 58 | <#phone> ?phone . 59 | 60 | OPTIONAL { 61 | ?supplier_row <#region> ?region 62 | } 63 | OPTIONAL { 64 | ?supplier_row <#fax> ?fax 65 | } 66 | OPTIONAL { 67 | ?supplier_row <#homePage> ?homePage 68 | } 69 | OPTIONAL { 70 | ?supplier_row <#lat> ?lat_string 71 | BIND(xsd:float(?lat_string) AS ?lat) 72 | } 73 | OPTIONAL { 74 | ?supplier_row <#long> ?long_string 75 | BIND(xsd:float(?long_string) AS ?long) 76 | } 77 | 78 | BIND(uri(concat(str($base), "suppliers/")) AS ?container) 79 | BIND(uri(concat(str(?container), encode_for_uri(?supplierID), "/")) AS ?graph) 80 | BIND(uri(concat(str(?graph), "#this")) AS ?supplier) 81 | BIND(uri(concat(str(?graph), "#contact-point")) AS ?contactPoint) 82 | BIND(uri(concat(str(?graph), "#employee")) AS ?employee) 83 | BIND(uri(concat(str(?graph), "#postal-address")) AS ?postalAddress) 84 | } 85 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/imports/territories.rq: -------------------------------------------------------------------------------- 1 | PREFIX foaf: 2 | PREFIX dct: 3 | PREFIX schema: 4 | 5 | CONSTRUCT 6 | { 7 | GRAPH ?graph 8 | { 9 | ?graph dct:title ?territoryDescription ; 10 | foaf:primaryTopic ?territory . 11 | 12 | ?territory a schema:City ; 13 | dct:title ?territoryDescription ; 14 | schema:name ?territoryDescription ; 15 | schema:identifier ?territoryID ; 16 | schema:containedInPlace ?region . 17 | } 18 | } 19 | WHERE 20 | { 21 | ?territory_row <#territoryID> ?territoryID ; 22 | <#territoryDescription> ?territoryDescription ; 23 | <#regionID> ?regionID . 24 | 25 | BIND(uri(concat(str($base), "territories/")) AS ?container) 26 | BIND(uri(concat(str(?container), encode_for_uri(?territoryID), "/")) AS ?graph) 27 | BIND(uri(concat(str(?graph), "#this")) AS ?territory) 28 | BIND(uri(concat(str($base), "regions/", encode_for_uri(?regionID), "/#this")) AS ?region) 29 | } 30 | -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-categories.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?category 4 | WHERE 5 | { GRAPH ?doc 6 | { ?category a schema:ProductGroup ; 7 | schema:name ?categoryName 8 | } 9 | } 10 | ORDER BY ?categoryName -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-customers.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?customer 4 | WHERE 5 | { GRAPH ?doc 6 | { ?customer a schema:Corporation ; 7 | schema:legalName ?companyName 8 | GRAPH ?orderDoc 9 | { ?order schema:customer ?customer } 10 | } 11 | } 12 | ORDER BY ?companyName -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-employees.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?employee 4 | WHERE 5 | { GRAPH ?doc 6 | { ?employee a schema:Person ; 7 | schema:familyName ?lastName 8 | OPTIONAL 9 | { ?employee schema:areaServed ?territory } 10 | OPTIONAL 11 | { ?employee schema:sponsor ?reportsToEmployee } 12 | FILTER NOT EXISTS { GRAPH ?supplierGraph 13 | { ?supplier a schema:Corporation ; 14 | schema:employee ?employee 15 | } 16 | } 17 | } 18 | } 19 | ORDER BY ?lastName -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-orders.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?order 4 | WHERE 5 | { GRAPH ?doc 6 | { ?order a schema:Order ; 7 | schema:identifier ?orderID ; 8 | schema:orderDate ?orderDate ; 9 | schema:customer ?customer ; 10 | schema:broker ?employee 11 | } 12 | } 13 | ORDER BY ?orderID -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-products.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?product 4 | WHERE 5 | { GRAPH ?doc 6 | { ?product a schema:Product ; 7 | schema:name ?productName ; 8 | schema:provider ?supplier ; 9 | schema:category ?category 10 | } 11 | } 12 | ORDER BY ?productName -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-regions.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?region 4 | WHERE 5 | { GRAPH ?doc 6 | { ?region a schema:Place ; 7 | schema:name ?regionDescription 8 | FILTER NOT EXISTS { ?region schema:containedInPlace [] } 9 | } 10 | } 11 | ORDER BY ?regionDescription -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-shippers.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?shipper 4 | WHERE 5 | { GRAPH ?doc 6 | { ?shipper a schema:Corporation ; 7 | schema:legalName ?companyName 8 | GRAPH ?orderDeliveryDoc 9 | { ?orderDelivery 10 | a schema:ParcelDelivery ; 11 | schema:provider ?shipper 12 | } 13 | } 14 | } 15 | ORDER BY ?companyName -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-suppliers.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?supplier 4 | WHERE 5 | { GRAPH ?doc 6 | { ?supplier a schema:Corporation ; 7 | schema:legalName ?companyName 8 | GRAPH ?productDoc 9 | { ?product a schema:Product ; 10 | schema:provider ?supplier 11 | } 12 | } 13 | } 14 | ORDER BY ?companyName -------------------------------------------------------------------------------- /demo/northwind-traders/queries/select-territories.rq: -------------------------------------------------------------------------------- 1 | PREFIX schema: 2 | 3 | SELECT DISTINCT ?territory 4 | WHERE 5 | { GRAPH ?doc 6 | { ?territory schema:name ?territoryDescription ; 7 | schema:containedInPlace ?region 8 | } 9 | } 10 | ORDER BY ?territoryDescription -------------------------------------------------------------------------------- /demo/northwind-traders/root.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a def:Root ; 11 | dct:title "Root" ; 12 | dct:description "Knowledge Graph representation of the Northwind Traders sample database" ; 13 | rdf:_1 <#page-header> ; 14 | rdf:_2 <#top-selling-products> ; 15 | rdf:_3 <#top-manager-header> ; 16 | rdf:_4 <#top-manager> ; 17 | rdf:_5 <#select-children> . 18 | 19 | <#page-header> a ldh:XHTML ; 20 | rdf:value """
21 | 25 |

Features include CSV data imports, SPARQL-based charts, faceted search and related results (parallax navigation) as well as 26 | rich documents composed of structured content backed by RDF Knowledge Graph data.

27 |

This application was created on LinkedDataHub using the low code paradigm: no programming was required, only scripts that 28 | invoke LinkedDataHub's CLI commands.

29 |

Below is an example of a chart, which is embedded into a document just by using its URI.

30 |
"""^^rdf:XMLLiteral . 31 | 32 | <#top-selling-products> a ldh:Object ; 33 | rdf:value . 34 | 35 | <#top-manager-header> a ldh:XHTML ; 36 | rdf:value """
37 |

Top manager

38 |

Meet the top manager of Northwind Traders.

39 |
"""^^rdf:XMLLiteral . 40 | 41 | <#top-manager> a ldh:Object ; 42 | rdf:value . 43 | 44 | <#select-children> a ldh:Object ; 45 | rdf:value ldh:ChildrenView . 46 | -------------------------------------------------------------------------------- /demo/northwind-traders/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/northwind-traders/screenshot.gif -------------------------------------------------------------------------------- /demo/northwind-traders/update-documents.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$2" 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | cat root.ttl | turtle --base="${base}" | put.sh \ 21 | -f "$cert_pem_file" \ 22 | -p "$cert_password" \ 23 | --proxy "$proxy" \ 24 | -t "application/n-triples" \ 25 | "$base" -------------------------------------------------------------------------------- /demo/northwind-traders/upload-file.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 5 ] && [ "$#" -ne 6 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password $pwd $abs_filename [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../ssl/owner/cert.pem Password /folder /folder/file.ttl [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$2" 12 | cert_password="$3" 13 | pwd="$4" 14 | filename="$5" 15 | 16 | if [ -n "$6" ]; then 17 | proxy="$6" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | path="${filename#*$pwd/}" # strip the leading $pwd/ 23 | title="${filename##*/}" # strip folders 24 | 25 | create-file.sh \ 26 | -b "$base" \ 27 | -f "$cert_pem_file" \ 28 | -p "$cert_password" \ 29 | --proxy "$proxy" \ 30 | --title "$title" \ 31 | --file "$filename" -------------------------------------------------------------------------------- /demo/skos/admin/acl/create-authorizations.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/demo/skos/ ../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pwd=$(realpath "$PWD") 23 | 24 | pushd . && cd "$SCRIPT_ROOT"/admin/acl 25 | 26 | sha1sum=$(sha1sum "$pwd"/../../files/skos.xsl | cut -d ' ' -f 1) 27 | 28 | ./create-authorization.sh \ 29 | -b "${base}admin/" \ 30 | -f "$cert_pem_file" \ 31 | -p "$cert_password" \ 32 | --proxy "$proxy" \ 33 | --label "Public SKOS XSLT stylesheet" \ 34 | --agent-class http://xmlns.com/foaf/0.1/Agent \ 35 | --to "${base}uploads/${sha1sum}/" \ 36 | --read 37 | 38 | ./create-authorization.sh \ 39 | -b "${base}admin/" \ 40 | -f "$cert_pem_file" \ 41 | -p "$cert_password" \ 42 | --proxy "$proxy" \ 43 | --label "Read access to graph items" \ 44 | --agent-class "http://www.w3.org/ns/auth/acl#AuthenticatedAgent" \ 45 | --to-all-in "https://www.w3.org/ns/ldt/document-hierarchy#Item" \ 46 | --read 47 | 48 | popd -------------------------------------------------------------------------------- /demo/skos/admin/clear-ontologies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/admin/ ../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file="$(realpath $2)" 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT"/admin 23 | 24 | ./clear-ontology.sh \ 25 | -f "$cert_pem_file" \ 26 | -p "$cert_password" \ 27 | -b "${base}admin/" \ 28 | --proxy "$proxy" \ 29 | --ontology "${base}ns#" 30 | 31 | popd -------------------------------------------------------------------------------- /demo/skos/admin/model/add-constraints.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT"/admin/model 23 | 24 | ./add-property-constraint.sh \ 25 | -b "${base}admin/" \ 26 | -f "$cert_pem_file" \ 27 | -p "$cert_password" \ 28 | --proxy "$proxy" \ 29 | --uri "${base}ns#MissingPrefLabel" \ 30 | --label "Missing skos:prefLabel" \ 31 | --slug missing-pref-label \ 32 | --property "http://www.w3.org/2004/02/skos/core#prefLabel" \ 33 | "${base}admin/ontologies/namespace/" 34 | 35 | popd -------------------------------------------------------------------------------- /demo/skos/admin/model/import-ontologies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/demo/skos/ ../../../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pushd . && cd "$SCRIPT_ROOT" 23 | 24 | skos_doc=$(./create-item.sh \ 25 | -b "${base}admin/" \ 26 | -f "$cert_pem_file" \ 27 | -p "$cert_password" \ 28 | --proxy "$proxy" \ 29 | --title "SKOS" \ 30 | --slug "skos" \ 31 | --container "${base}admin/ontologies/" 32 | ) 33 | 34 | popd 35 | 36 | pushd . && cd "$SCRIPT_ROOT"/admin/model 37 | 38 | ./import-ontology.sh \ 39 | -b "${base}admin/" \ 40 | -f "$cert_pem_file" \ 41 | -p "$cert_password" \ 42 | --proxy "$proxy" \ 43 | --source "http://www.w3.org/2004/02/skos/core" \ 44 | --graph "$skos_doc" 45 | 46 | popd 47 | 48 | pushd . && cd "$SCRIPT_ROOT/admin" 49 | 50 | ./add-ontology-import.sh \ 51 | -f "$cert_pem_file" \ 52 | -p "$cert_password" \ 53 | --proxy "$proxy" \ 54 | --import "http://www.w3.org/2004/02/skos/core" \ 55 | "${base}admin/ontologies/namespace/" 56 | 57 | popd -------------------------------------------------------------------------------- /demo/skos/admin/sitemap/queries/describe-concept.rq: -------------------------------------------------------------------------------- 1 | PREFIX skos: 2 | PREFIX rdfs: 3 | PREFIX foaf: 4 | 5 | DESCRIBE $this ?concept ?narrower ?broader ?related 6 | WHERE 7 | { GRAPH ?graph 8 | { $this ?p ?o 9 | OPTIONAL 10 | { $this foaf:primaryTopic ?concept 11 | OPTIONAL 12 | { { GRAPH ?narrowerGraph 13 | { ?concept skos:narrower ?narrower } 14 | } 15 | UNION 16 | { GRAPH ?narrowerGraph 17 | { ?narrower skos:broader ?concept } 18 | } 19 | } 20 | OPTIONAL 21 | { { GRAPH ?broaderGraph 22 | { ?concept skos:broader ?broader } 23 | } 24 | UNION 25 | { GRAPH ?broaderGraph 26 | { ?broader skos:narrower ?concept } 27 | } 28 | } 29 | OPTIONAL 30 | { { GRAPH ?relatedGraph 31 | { ?concept skos:related ?related } 32 | } 33 | UNION 34 | { GRAPH ?relatedGraph 35 | { ?related skos:related ?concept } 36 | } 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /demo/skos/create-containers.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pwd=$(realpath "$PWD") 23 | 24 | pushd . && cd "$SCRIPT_ROOT" 25 | 26 | select_concepts_doc=$(./create-select.sh \ 27 | -b "$base" \ 28 | -f "$cert_pem_file" \ 29 | -p "$cert_password" \ 30 | --proxy "$proxy" \ 31 | --title "Select concepts" \ 32 | --slug select-concepts \ 33 | --query-file "$pwd/queries/select-concepts.rq" 34 | ) 35 | 36 | select_concepts_ntriples=$(./get.sh \ 37 | -f "$cert_pem_file" \ 38 | -p "$cert_password" \ 39 | --proxy "$proxy" \ 40 | --accept 'application/n-triples' \ 41 | "$select_concepts_doc" 42 | ) 43 | 44 | select_concepts=$(echo "$select_concepts_ntriples" | sed -rn "s/<${select_concepts_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 45 | 46 | concept_container=$(./create-container.sh \ 47 | -b "$base" \ 48 | -f "$cert_pem_file" \ 49 | -p "$cert_password" \ 50 | --proxy "$proxy" \ 51 | --title "Concepts" \ 52 | --slug "concepts" \ 53 | --parent "$base" 54 | ) 55 | 56 | ./remove-content.sh \ 57 | -f "$cert_pem_file" \ 58 | -p "$cert_password" \ 59 | --proxy "$proxy" \ 60 | "$concept_container" 61 | 62 | ./append-content.sh \ 63 | -f "$cert_pem_file" \ 64 | -p "$cert_password" \ 65 | --proxy "$proxy" \ 66 | --value "$select_concepts" \ 67 | "$concept_container" 68 | 69 | 70 | select_concept_schemes_doc=$(./create-select.sh \ 71 | -b "$base" \ 72 | -f "$cert_pem_file" \ 73 | -p "$cert_password" \ 74 | --proxy "$proxy" \ 75 | --title "Select concept schemes" \ 76 | --slug select-concept-schemes \ 77 | --query-file "$pwd/queries/select-concept-schemes.rq" 78 | ) 79 | 80 | select_concept_schemes_ntriples=$(./get.sh \ 81 | -f "$cert_pem_file" \ 82 | -p "$cert_password" \ 83 | --proxy "$proxy" \ 84 | --accept 'application/n-triples' \ 85 | "$select_concept_schemes_doc" 86 | ) 87 | 88 | select_concept_schemes=$(echo "$select_concept_schemes_ntriples" | sed -rn "s/<${select_concept_schemes_doc//\//\\/}> <(.*)> \./\1/p" | head -1) 89 | 90 | concept_scheme_container=$(./create-container.sh \ 91 | -b "$base" \ 92 | -f "$cert_pem_file" \ 93 | -p "$cert_password" \ 94 | --proxy "$proxy" \ 95 | --title "Concept schemes" \ 96 | --slug "concept-schemes" \ 97 | --parent "$base" 98 | ) 99 | 100 | ./remove-content.sh \ 101 | -f "$cert_pem_file" \ 102 | -p "$cert_password" \ 103 | --proxy "$proxy" \ 104 | "$concept_scheme_container" 105 | 106 | ./append-content.sh \ 107 | -f "$cert_pem_file" \ 108 | -p "$cert_password" \ 109 | --proxy "$proxy" \ 110 | --value "$select_concept_schemes" \ 111 | "$concept_scheme_container" 112 | 113 | popd -------------------------------------------------------------------------------- /demo/skos/import-rdf.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file=$(realpath "$2") 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | pwd=$(realpath "$PWD") 23 | 24 | pushd . && cd "$SCRIPT_ROOT"/imports 25 | 26 | ./import-rdf.sh \ 27 | -b "$base" \ 28 | -f "$cert_pem_file" \ 29 | -p "$cert_password" \ 30 | --proxy "$proxy" \ 31 | --title "UN thesaurus SKOS (part 1)" \ 32 | --query-file "$pwd/queries/skos-import.rq" \ 33 | --file "$pwd/files/unesco-thesaurus.part1.ttl" \ 34 | --file-content-type "text/turtle" 35 | 36 | #./import-rdf.sh \ 37 | # -b "$base" \ 38 | # -f "$cert_pem_file" \ 39 | # -p "$cert_password" \ 40 | # --proxy "$proxy" \ 41 | # --title "UN thesaurus SKOS" \ 42 | # --query-file "$pwd/queries/skos-import.rq" \ 43 | # --file "$pwd/files/unesco-thesaurus.part2.ttl" \ 44 | # --file-content-type "text/turtle" 45 | 46 | popd > /dev/null -------------------------------------------------------------------------------- /demo/skos/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | pwd="$(realpath "$PWD")" 21 | 22 | pushd . 23 | 24 | printf "\n### Creating authorization to make the app public\n\n" 25 | 26 | "$SCRIPT_ROOT"/admin/acl/make-public.sh -b "$base" -f "$cert_pem_file" -p "$cert_password" --proxy "$proxy" 27 | 28 | printf "\n### Creating authorizations\n\n" 29 | 30 | cd admin/acl 31 | 32 | ./create-authorizations.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 33 | 34 | cd .. 35 | 36 | cd model 37 | 38 | printf "\n### Import ontologies\n\n" 39 | 40 | ./import-ontologies.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 41 | 42 | printf "\n### Creating constraints\n\n" 43 | 44 | ./create-constraints.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 45 | 46 | cd .. 47 | 48 | printf "\n### Clearing ontologies\n\n" 49 | 50 | ./clear-ontologies.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 51 | 52 | popd 53 | 54 | printf "\n### Uploading CSS/XSLT files\n\n" 55 | 56 | ./upload-file.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" "${pwd}/files/bootstrap.min.css" 'text/css' "$proxy" 57 | 58 | ./upload-file.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" "${pwd}/files/skos.xsl" 'text/xsl' "$proxy" 59 | 60 | printf "\n### Creating containers\n\n" 61 | 62 | ./create-containers.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 63 | 64 | printf "\n### Updating documents\n\n" 65 | 66 | ./update-documents.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 67 | 68 | printf "\n### Importing SKOS vocabulary\n\n" 69 | 70 | ./import-rdf.sh "$base" "$cert_pem_file" "$cert_password" "$proxy" 71 | -------------------------------------------------------------------------------- /demo/skos/queries/select-concept-schemes.rq: -------------------------------------------------------------------------------- 1 | PREFIX skos: 2 | PREFIX foaf: 3 | PREFIX sioc: 4 | 5 | SELECT DISTINCT ?conceptScheme ?doc 6 | WHERE 7 | { GRAPH ?doc 8 | { ?doc sioc:has_container $this ; 9 | foaf:primaryTopic ?conceptScheme 10 | GRAPH ?conceptSchemeGraph 11 | { ?conceptScheme 12 | skos:prefLabel ?prefLabel 13 | } 14 | } 15 | } 16 | ORDER BY ?prefLabel -------------------------------------------------------------------------------- /demo/skos/queries/select-concepts.rq: -------------------------------------------------------------------------------- 1 | PREFIX skos: 2 | PREFIX foaf: 3 | PREFIX sioc: 4 | 5 | SELECT DISTINCT ?concept ?doc 6 | WHERE 7 | { GRAPH ?doc 8 | { ?doc sioc:has_container $this ; 9 | foaf:primaryTopic ?concept 10 | GRAPH ?conceptGraph 11 | { ?concept skos:prefLabel ?prefLabel } 12 | OPTIONAL 13 | { GRAPH ?broaderGraph 14 | { ?concept skos:broader ?broader } 15 | } 16 | OPTIONAL 17 | { GRAPH ?relatedGraph 18 | { ?concept skos:related ?related } 19 | } 20 | } 21 | } 22 | ORDER BY ?prefLabel -------------------------------------------------------------------------------- /demo/skos/queries/skos-import.rq: -------------------------------------------------------------------------------- 1 | PREFIX dh: 2 | PREFIX sioc: 3 | PREFIX foaf: 4 | PREFIX skos: 5 | PREFIX dct: 6 | 7 | CONSTRUCT 8 | { 9 | GRAPH ?item 10 | { 11 | ?thing ?p ?o . 12 | ?item a dh:Item ; 13 | sioc:has_container ?container ; 14 | dct:title ?prefLabel ; 15 | foaf:primaryTopic ?thing . 16 | } 17 | } 18 | WHERE 19 | { 20 | SELECT * 21 | { 22 | { 23 | ?thing a skos:Concept 24 | BIND (uri(concat(str($base), "concepts/")) AS ?container) 25 | } 26 | UNION 27 | { 28 | ?thing a skos:ConceptScheme 29 | BIND (uri(concat(str($base), "concept-schemes/")) AS ?container) 30 | } 31 | BIND (uri(concat(str(?container), STRUUID(), "/")) AS ?item) 32 | ?thing ?p ?o 33 | OPTIONAL 34 | { 35 | ?thing skos:prefLabel ?prefLabel 36 | FILTER (langMatches(lang(?prefLabel), "en")) 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /demo/skos/root.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a def:Root ; 10 | dct:title "Root" ; 11 | dct:description "SKOS-based editor of thesauri, lexicons, vocabularies, taxonomies, and classification schemes" ; 12 | rdf:_1 <#page-header> ; 13 | rdf:_2 <#select-children> . 14 | 15 | <#page-header> a ldh:Content ; 16 | rdf:value """
17 | 21 |
"""^^rdf:XMLLiteral . 22 | 23 | <#select-children> a ldh:Content ; 24 | rdf:value ldh:ChildrenView . -------------------------------------------------------------------------------- /demo/skos/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/demo/skos/screenshot.png -------------------------------------------------------------------------------- /demo/skos/update-documents.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | [ -z "$SCRIPT_ROOT" ] && echo "Need to set SCRIPT_ROOT" && exit 1; 4 | 5 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 6 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 7 | echo "Example: $0" 'https://localhost:4443/ ../../../ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 8 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 9 | exit 1 10 | fi 11 | 12 | base="$1" 13 | cert_pem_file="$2" 14 | cert_password="$3" 15 | 16 | if [ -n "$4" ]; then 17 | proxy="$4" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | cat root.ttl | turtle --base="${base}" | "$SCRIPT_ROOT"/put.sh \ 23 | -f "$cert_pem_file" \ 24 | -p "$cert_password" \ 25 | --proxy "$proxy" \ 26 | -t "application/n-triples" \ 27 | "$base" -------------------------------------------------------------------------------- /demo/skos/upload-file.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 6 ] && [ "$#" -ne 7 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password $pwd $abs_filename content_type [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../ssl/owner/cert.pem Password /folder /folder/file.ttl 'text/css' [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$2" 12 | cert_password="$3" 13 | pwd="$4" 14 | filename="$5" 15 | content_type="$6" 16 | 17 | if [ -n "$7" ]; then 18 | proxy="$7" 19 | else 20 | proxy="$base" 21 | fi 22 | 23 | path="${filename#*$pwd/}" # strip the leading $pwd/ 24 | title="${filename##*/}" # strip folders 25 | 26 | pushd . && cd "$SCRIPT_ROOT/imports" 27 | 28 | ./create-file.sh \ 29 | -b "$base" \ 30 | -f "$cert_pem_file" \ 31 | -p "$cert_password" \ 32 | --proxy "$proxy" \ 33 | --title "$title" \ 34 | --file "$filename" \ 35 | --file-content-type "$content_type" 36 | 37 | popd -------------------------------------------------------------------------------- /linkeddatahub/docs/Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | BASE_URL_DEFAULT=https://localhost:4443/ 4 | CERT_PATH_DEFAULT=../../../LinkedDataHub/ssl/owner/cert.pem 5 | PROXY_URL_DEFAULT=https://localhost:5443/ 6 | 7 | install: 8 | @read -p "Enter Base URL [$(BASE_URL_DEFAULT)]: " BASE_URL; \ 9 | BASE_URL=$${BASE_URL:-$(BASE_URL_DEFAULT)}; \ 10 | read -p "Enter Certificate Path [$(CERT_PATH_DEFAULT)]: " CERT_PATH; \ 11 | CERT_PATH=$${CERT_PATH:-$(CERT_PATH_DEFAULT)}; \ 12 | read -s -p "Enter Certificate Password (required): " PASSWORD; \ 13 | echo ""; \ 14 | if [ -z "$${PASSWORD}" ]; then \ 15 | echo "Password cannot be empty. Aborting."; \ 16 | exit 1; \ 17 | fi; \ 18 | read -p "Enter Proxy URL (optional) [$(PROXY_URL_DEFAULT)]: " PROXY_URL; \ 19 | if [ -n "$${PROXY_URL}" ]; then \ 20 | ./install.sh "$${BASE_URL}" "$${CERT_PATH}" "$${PASSWORD}" "$${PROXY_URL}"; \ 21 | else \ 22 | ./install.sh "$${BASE_URL}" "$${CERT_PATH}" "$${PASSWORD}"; \ 23 | fi 24 | 25 | validate: 26 | ./validate-documents.sh 27 | 28 | ttl-to-html: 29 | ./ttl-to-html.sh 30 | -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/action.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/browse-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/browse-data.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/change-layout-augment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/change-layout-augment.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/change-layout-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/change-layout-default.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/change-layout-suppress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/change-layout-suppress.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/create context.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/create context.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/create edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/create edit.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/layout.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/navigation bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/navigation bar.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/reference/data-management/resources/chart-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/reference/data-management/resources/chart-block.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/reference/data-management/resources/query-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/reference/data-management/resources/query-block.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/reference/data-management/resources/view-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/reference/data-management/resources/view-block.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/request-access1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/request-access1.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/request-access2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/request-access2.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/search.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/signup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/signup.png -------------------------------------------------------------------------------- /linkeddatahub/docs/files/images/sparql endpoint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/images/sparql endpoint.jpg -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/AddData.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/AddData.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/Create.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/Create.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/CreateContextDataspace.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/CreateContextDataspace.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/Delete.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/Delete.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/DocTree.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/DocTree.gif -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/Download.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/Download.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/Edit.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/Edit.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/ParallaxNav.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/ParallaxNav.gif -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/RequestAccess.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/RequestAccess.mov -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/RequestAccess.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/RequestAccess.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/Upload.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/Upload.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/files/videos/View.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/files/videos/View.webm -------------------------------------------------------------------------------- /linkeddatahub/docs/get-started/request-access.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Request access" ; 12 | dct:description "How to get access to an application" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

This guide describes how to get access to an application.

18 |
19 |

After you have logged in to LinkedDataHub, by default you do not have access rights to view or edit the documents in the dataspace. The owner of the dataspace has to create 20 | an explicit authorization to allow access for you.

21 |

Fortunately, LinkedDataHub makes it easy to notify the owner by issuing an access request. Navigate to the document you want to gain access to, click on the 22 | Request access button and submit the form that appears, as shown below. You can choose the desired access modes.

23 |

24 | 25 |

26 |
27 |

Are you in? Then continue the get started guide or take a look at the UI overview.

28 |
"""^^rdf:XMLLiteral . 29 | -------------------------------------------------------------------------------- /linkeddatahub/docs/install.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/1e247e74ce273ef875e54eb46fcb3c6d28a2418c/linkeddatahub/docs/install.log -------------------------------------------------------------------------------- /linkeddatahub/docs/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../../LinkedDataHub/ssl/owner/cert.pem Password [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file=$(realpath "$2") 12 | cert_password="$3" 13 | 14 | if [ -n "$4" ]; then 15 | proxy="$4" 16 | else 17 | proxy="$base" 18 | fi 19 | 20 | pwd="$(realpath "$PWD")" 21 | 22 | printf "\n### Creating authorization to make the app public\n\n" 23 | 24 | make-public.sh -b "$base" -f "$cert_pem_file" -p "$cert_password" --proxy "$proxy" 25 | 26 | printf "\n### Creating authorizations\n\n" 27 | 28 | printf "\n### Update documents (traversing folders recursively)\n\n" 29 | 30 | ./update-folder.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" "$pwd" "$proxy" 31 | 32 | printf "\n### Uploading images\n\n" 33 | 34 | find "${pwd}/files/images" -type f -exec ./upload-file.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" {} "$proxy" \; 35 | 36 | printf "\n### Uploading videos\n\n" 37 | 38 | find "${pwd}/files/videos" -type f -exec ./upload-file.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" {} "$proxy" \; -------------------------------------------------------------------------------- /linkeddatahub/docs/reference.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "Reference" ; 13 | dct:description "A list of LinkedDataHub's features and their functions, split into general and administration parts" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

A list of LinkedDataHub's features and their functions, split into general and administration parts

20 |
"""^^rdf:XMLLiteral . 21 | 22 | <#select-children> a ldh:Object ; 23 | rdf:value ldh:ChildrenView . 24 | -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/administration.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "Administration" ; 13 | dct:description "Access control and domain model management" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

Access control and domain model management

20 |

Administration is provided in a separate LDT application, which is paired with each end-user 21 | application.

22 |
"""^^rdf:XMLLiteral . 23 | 24 | <#select-children> a ldh:Object ; 25 | rdf:value ldh:ChildrenView . 26 | -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "Data model" ; 13 | dct:description "Document and content structure as well as actions that can be performed on them" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

Document and content structure as well as actions that can be performed on them.

20 |
"""^^rdf:XMLLiteral . 21 | 22 | <#select-children> a ldh:Object ; 23 | rdf:value ldh:ChildrenView . 24 | -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model/blocks.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Container ; 10 | sioc:has_parent <..> ; 11 | dct:title "Content blocks" ; 12 | dct:description "Content blocks and the basic data content actions" ; 13 | rdf:_1 <#content> ; 14 | rdf:_2 <#select-children> . 15 | 16 | <#content> a ldh:XHTML ; 17 | rdf:value """
18 |

Content blocks and the basic data content actions.

19 |
20 |

Content list is a layout mode introduced in LinkedDataHub 3.x. It allow composition of rich, structured web documents from multiple types of content blocks.

21 |

The blocks are attached to the document resource using RDF sequence properties rdf:_1, rdf:_2 etc. 22 | The index number in the property URI indicates the position of the content block on the document's content list.

23 |

The blocks have 2 main types: XHTML (ldh:XHTML) and object (ldh:Object).

24 |

The blocks can be re-arranged by dragging one of them and dropping them in a different position.

25 |
26 |
"""^^rdf:XMLLiteral . 27 | 28 | <#select-children> a ldh:Object ; 29 | rdf:value ldh:ChildrenView . 30 | -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model/blocks/xhtml.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "XHTML blocks" ; 12 | dct:description "Blocks that embed XHTML markup as an RDF literal" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Blocks that embed XHTML markup as an RDF literal

18 |

XHTML block is simply a fragment of XHTML, stored as a canonical XML literal in the RDF document. It can be edited using a WYSIWYG editor.

19 |
20 |

RDF serialization

21 |
@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .
22 | @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
23 | 
24 | <https://localhost:4443/concepts/example/#xhtml-block>
25 |     a       ldh:XHTML ;
26 |     rdf:value "<div xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\\n<p>A paragraph</p>\\n</div>"^^rdf:XMLLiteral .
27 |
28 |
29 |

Management

30 |
31 |

User interface

32 |

Content blocks can only be managed when the Content layout mode is active.

33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |
ActionDescription
CreateClick the XHTML button at the bottom of the page (in content mode). Create the XHTML content in the WYSIWYG editor. Click Save.
UpdateClick the button in the top-right corner of the block (it will only appear when you move the mouse close to that corner). Change the XHTML content in the WYSIWYG editor. Click Save.
DeleteClick the button in the top-right corner of the block (it will only appear when you move the mouse close to that corner). Click the button to delete the block.
55 |
56 |
57 |

Command line interface

58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
ActionCLI script
Createadd-xhtml-block.sh
Update
Delete
80 |
81 |
82 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model/documents.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Container ; 10 | sioc:has_parent <..> ; 11 | dct:title "Documents" ; 12 | dct:description "Document hierarchy and the basic data management actions" ; 13 | rdf:_1 <#content> ; 14 | rdf:_2 <#select-children> . 15 | 16 | <#content> a ldh:XHTML ; 17 | rdf:value """
18 |

Document structure and the basic data management actions.

19 |
20 |

Document hierarchy

21 |

The basic structure of resources in a LinkedDataHub application is analogous to the file system, but built using RDF 22 | resources and relationships between them instead. There is a hierarchy of containers (folders), 23 | which are collections of items (files) as well as sub-containers (sub-folders). Both containers 24 | (instances of dh:Container) and items (instances of dh:Item) are documents (instances of foaf:Document). Items cannot contain other documents.

25 |

The first level of resources in a container is referred to as its children (of which that container 26 | is the parent, while all levels down the hierarchy are collectively referred to as 27 | descendants.

28 |

When a user logs in, the application loads its root container (unless a specific URI was requested). From there, 29 | users can navigate down the resource hierarchy, starting with children of the root container. At 30 | any moment there is only one current document per page, on which management actions can 31 | be performed: it can be viewed, edited etc.

32 |
33 |
"""^^rdf:XMLLiteral . 34 | 35 | <#select-children> a ldh:Object ; 36 | rdf:value ldh:ChildrenView . 37 | -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model/resources/charts.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Charts" ; 12 | dct:description "Interactive charts based on SPARQL queries" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Interactive charts based on SPARQL queries

18 |

19 | Chart 20 |

21 |

Charts can render results both types of SPARQL results:

22 |
    23 |
  • tabular SELECT results
  • 24 |
  • graph results of DESCRIBE and CONSTRUCT
  • 25 |
26 |

In that sense they are similar to the chart layout mode in 27 | views, but charts also store the chart type as well as the category and series information: variable names in the 28 | case of tabular results, and property URIs in the case of graph results.

29 |

The default chart type is the table. Other chart types might not apply to all result data; for example a 30 | scatter chart will need a numeric or datetime values for both category and series.

31 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model/resources/queries.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Queries" ; 12 | dct:description "Interactive SPARQL queries" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Interactive SPARQL queries

18 |

19 | Query 20 |

21 |

Queries are SPARQL 1.1 query strings that can be executed interactively. They can be defined with a SPARQL 22 | service that they execute against, otherwise they execute against the application's own SPARQL service.

23 |

It is only possible to save valid SPARQL 1.1 query strings. SPARQL updates are currently not supported.

24 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/data-model/resources/views.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Views" ; 12 | dct:description "Paginated views based on SPARQL queries" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Paginated views based on SPARQL queries

18 |

19 | View 20 |

21 |

Views are interactive, paginated, and optionally ordered results of a SPARQL SELECT result set. 22 | What is rendered in the UI is not directly the tabular result however, but descriptions of the resources selected 23 | by the result set. That is achieved by on-the-fly SPARQL query rewriting: the SELECT is wrapped into 24 | a DESCRIBE query; DESCRIBE reuses the same variables from the SELECT projection. 25 | This will not work for all SELECT queries.

26 |

To render paginated lists of resources, legacy applications would normally have a dedicated API endpoint that 27 | supports pagination, ordering etc. In LinkedDataHub, views achieve the same functionality by simply building the 28 | SPARQL query string on the client-side. Therefore views can be seen as client-side "containers".

29 |

Views can be rendered in multiple layout modes: properties, list, grid, table, map, chart etc. They also show 30 | the total number of results and allow result ordering by property.

31 |
32 |

Layout modes

33 |

View results can be rendered using the same layout modes as the document layout modes.

34 |
35 |
36 | 37 |

On the left side, views provide faceted search which acts as a filter that narrows down the view results.

38 |

By default the facets are generic and inferred from the triple patterns of the SPARQL SELECT query used by the view. They can be customized using XSLT.

39 |
40 |
41 |

Parallax navigation

42 |

Parallax navigation is a rather unique navigation approach that lends itself perfectly to graph data. It is enabled for container content and shown as Related results on the right side of the view. Parallax allows "jumping" from a result set to a related result set using the selected RDF property. It works in 43 | combination with faceted search which can be used to filter the initial result set.

44 |

For example, facets can be used to filter a set products that belong to a certain category, and then parallax can be used to jump to a set of companies that provide those products, and then further on to 45 | a set representatives of those companies.

46 |

47 | Related results 48 |

49 |
50 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/dataset.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "RDF dataset" ; 12 | dct:description "The default RDF dataset structure used by LinkedDataHub" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

The default RDF dataset structure used by LinkedDataHub.

18 |
19 |

Structure

20 |

Default LinkedDataHub dataset structure follows these conventions:

21 |
    22 |
  1. the default graph is not used
  2. 23 |
  3. each document's description is stored in an RDF named graph whose name is the same as the document URI. The graph can be managed using the Graph Store Protocol.
  4. 24 |
  5. documents form a parent/child hierarchy. There are 2 types of documents: containers that can have other documents as children, and items that cannot.
  6. 25 |
26 |

The default dataset is installed into an application service during the setup.

27 |
28 |
29 |

Hierarchical URIs

30 |

By default, the URIs of the document resources represent the same parent/child hierarchy. Which means the root container's URI equals the base URI 31 | of the application, and descendant document URIs are relative to their parent container URIs.

32 |

Uploaded files are an exception to this rule. They are content-addressed in the uploads/{sha1sum} namespace, where sha1sum is the SHA1 hash of the file content.

33 |
34 |
35 |

Default datasets

36 |

The default datasets of administration and end-user applications can be found in platform/datasets/admin.trig and 37 | platform/datasets/end-user.trig, respectively.

38 |

RDF terms (classes, properties etc.) used in the default datasets come from well-known vocabularies FOAF and SIOC (with additional LinkedDataHub-specific assertions) as well as system ontologies.

39 |
40 |
41 |

Storage

42 |

The dataset of each application is stored in an RDF triplestore which is accessed as a SPARQL service. End-user applications and admin applications have separate datasets and are backed by two different services.

43 |
44 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/reference/imports.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "Imports" ; 13 | dct:description "Types of data imports supported by LinkedDataHub" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

Types of data imports supported by LinkedDataHub

20 |
"""^^rdf:XMLLiteral . 21 | 22 | <#select-children> a ldh:Object ; 23 | rdf:value ldh:ChildrenView . 24 | -------------------------------------------------------------------------------- /linkeddatahub/docs/sha1map-to-xml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TARGET_DIR="${1:-.}" 4 | 5 | # Ensure absolute path 6 | ABS_TARGET_DIR=$(cd "$TARGET_DIR" && pwd) 7 | 8 | echo '' 9 | echo '' 10 | echo ' ' 11 | 12 | find "$ABS_TARGET_DIR" -type f | while read -r file; do 13 | sha=$(shasum -a 1 "$file" | awk '{print $1}') 14 | relpath="${file#$ABS_TARGET_DIR/}" 15 | safe_name=$(printf "%s" "$relpath" | xmlstarlet esc) 16 | 17 | echo ' ' 18 | echo " $safe_name" 19 | echo " $sha" 20 | echo ' ' 21 | done 22 | 23 | echo ' ' 24 | echo '' 25 | -------------------------------------------------------------------------------- /linkeddatahub/docs/ttl-to-html.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # absolute path to output folder 3 | OUTPUT_FOLDER="$PWD"/html 4 | # find all the turtle files and use Jena riot to convert them to TriX format, merging them into a single trix file 5 | # (sed is used to trim the root element from the individual files) 6 | 7 | # The individual Turtle files are in actual fact not distinct graphs with their own base URI; they are all fragments of a single graph, 8 | # as is evidenced by the way that some of them have a #has_parent relationships referring to that same graph as <>, so for this 9 | # conversion, we maintain the correct references by explicitly assigning all the graphs relative URIs based on their filepath. 10 | # The script uses sed to trim the first and last lines from each TriX file (the start and end tags for the root trix element), 11 | # so as to be able to concatenate the trix data into a single file. 12 | echo '' > docs.trix 13 | # construct base URI from filepath and append the TriX data to the docs.trix file 14 | find . -name "*.ttl" -exec sh -c 'riot --output=trix --base="file:///$(echo "$1" | sed "s|^\./||; s|\.ttl$|/|")" "$1" | sed "1d;\$d" >> docs.trix' sh {} \; 15 | echo '' >> docs.trix 16 | 17 | ./sha1map-to-xml.sh files > files.xml 18 | 19 | mkdir -p "$OUTPUT_FOLDER" 20 | 21 | # recursively copy the files folder to the output folder 22 | cp -r files "$OUTPUT_FOLDER" 23 | 24 | # convert the TriX data file to a set of XHTML pages 25 | docker run --rm -v "$PWD":"/docs" -v "$OUTPUT_FOLDER":"/output" atomgraph/saxon -s:/docs/docs.trix -xsl:/docs/trix-to-html.xsl output-folder="/output" 26 | # delete the temporary trix file 27 | #rm docs.trix -------------------------------------------------------------------------------- /linkeddatahub/docs/update-document.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 5 ] && [ "$#" -ne 6 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password $pwd $abs_filename [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../ssl/owner/cert.pem Password /folder /folder/file.ttl [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$2" 12 | cert_password="$3" 13 | pwd="$4" 14 | filename="$5" 15 | 16 | if [ -n "$6" ]; then 17 | proxy="$6" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | path="${filename%.*}" # strip the extension 23 | path="${path#*$pwd/}" # strip the leading $pwd/ 24 | path="${path}/" # add trailing slash 25 | 26 | pushd . && cd "$SCRIPT_ROOT" 27 | 28 | printf "\n### Updating %s\n" "${base}${path}" 29 | 30 | cat "$filename" | turtle --base="${base}${path}" | put.sh \ 31 | -f "$cert_pem_file" \ 32 | -p "$cert_password" \ 33 | --proxy "$proxy" \ 34 | -t "application/n-triples" \ 35 | "${base}${path}" 36 | 37 | popd -------------------------------------------------------------------------------- /linkeddatahub/docs/update-folder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -ne 5 ] && [ "$#" -ne 6 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password $pwd $abs_folder [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../ssl/owner/cert.pem Password /folder /folder/ [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$2" 12 | cert_password="$3" 13 | pwd="$4" 14 | folder="$5" 15 | 16 | if [ -n "$6" ]; then 17 | proxy="$6" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | echo "Processing folder: $folder" # Debug output 23 | 24 | for ttl_file in "$folder"/*.ttl; do 25 | if [[ -f "$ttl_file" ]]; then 26 | echo "Found .ttl file: $ttl_file" # Debug output 27 | ./update-document.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" "$ttl_file" "$proxy" 28 | fi 29 | done 30 | 31 | find "$folder" -mindepth 1 -maxdepth 1 -type d -exec ./update-folder.sh "$base" "$cert_pem_file" "$cert_password" "$pwd" {} "$proxy" \; 32 | -------------------------------------------------------------------------------- /linkeddatahub/docs/upload-file.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ "$#" -ne 5 ] && [ "$#" -ne 6 ]; then 4 | echo "Usage: $0" '$base $cert_pem_file $cert_password $pwd $abs_filename [$proxy]' >&2 5 | echo "Example: $0" 'https://localhost:4443/ ../../ssl/owner/cert.pem Password /folder /folder/file.ttl [https://localhost:5443/]' >&2 6 | echo "Note: special characters such as $ need to be escaped in passwords!" >&2 7 | exit 1 8 | fi 9 | 10 | base="$1" 11 | cert_pem_file="$2" 12 | cert_password="$3" 13 | pwd="$4" 14 | filename="$5" 15 | 16 | if [ -n "$6" ]; then 17 | proxy="$6" 18 | else 19 | proxy="$base" 20 | fi 21 | 22 | echo "Uploading file: $filename" # Debug output 23 | 24 | path="${filename#*$pwd/}" # strip the leading $pwd/ 25 | title="${filename##*/}" # strip folders 26 | 27 | create-file.sh \ 28 | -b "$base" \ 29 | -f "$cert_pem_file" \ 30 | -p "$cert_password" \ 31 | --proxy "$proxy" \ 32 | --title "$title" \ 33 | --file "$filename" 34 | -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "User guide" ; 13 | dct:description "Step-by-step tutorials for everyday tasks with LinkedDataHub" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

Step-by-step tutorials for everyday tasks with LinkedDataHub

20 |
"""^^rdf:XMLLiteral . 21 | 22 | <#select-children> a ldh:Object ; 23 | rdf:value ldh:ChildrenView . 24 | -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/add-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Add data" ; 12 | dct:description "Fork RDF data from Linked Data resources and SPARQL results" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Fork RDF data from Linked Data resources and SPARQL results

18 |

You can fork (copy the contents of) any RDF document to a namedgraph in your dataspace. Two sources of RDF are supported: RDF resources on the web (Linked Data), and RDF file uploads.

19 |
20 |

Adding data this way will cause a blocking request, so use it for small amounts of data only (e.g. a few thousands of RDF triples). 21 | For larger data, use asynchronous RDF imports.

22 |
23 |
24 |

From Linked Data

25 |

26 | 27 |

28 |

To copy the contents of the current RDF document (local or remote) into a local document, follow these steps:

29 |
    30 |
  1. Click on the Save button on the right side of the action bar. 31 | A form will open with the following fields: 32 |
    33 |
    Source
    34 |
    URI of the source document
    35 |
    Graph
    36 |
    The target document. You can start typing to find it by its label, or paste its URI here.
    37 |
    38 |
  2. 39 |
  3. Click Save to perform the fork operation.
  4. 40 |
41 |
42 |
43 |

From file

44 |

To upload the contents of an RDF file into a document, simnply drag the file from your filesystem into LinkedDataHub. The following syntaxes are supported:

45 |
    46 |
  • N-Triples (.nt)
  • 47 |
  • Turtle (.ttl)
  • 48 |
  • RDF/XML (.rdf and .owl)
  • 49 |
  • JSON-LD (.jsonld)
  • 50 |
51 |
52 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/browse-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Browse data" ; 12 | dct:description "Use LinkedDataHub's built-in Linked Data browser to explore remote datasources" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Use LinkedDataHub's built-in Linked Data browser to explore remote datasources

18 |

LinkedDataHub's has a built-in Linked Data browser which is accessed through the navigation bar. Enter a http:// or https:// URL and 19 | press Enter or click the search button.

20 |

The browser supports all standard RDF formats as well as JSON-LD embedded in HTML page's <script> elements, which is often used to publish schema.org metadata.

21 |

When the data loads successfully, you can navigate it the same way as your local documents, switch between different layout modes etc. You can also add the data into your dataspace.

22 |

If an RDF document cannot be read from the supplied URL, an error message will be shown.

23 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/change-system-base-uri.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Change system base URI" ; 12 | dct:description "How to change host, port, or the path LinkedDataHub service runs on" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

How to change host, port, or the path LinkedDataHub service runs on

18 |
19 |

System base URI

20 |

System base URI is the URI on which the LinkedDataHub service is accessible.

21 |

A common case is changing the system base URI from the default https://localhost:4443/ to your own.

22 |

Lets use https://ec2-54-235-229-141.compute-1.amazonaws.com/linkeddatahub/ as an example. We need to split the URI into components and set them in the .env file using the following parameters:

23 |
PROTOCOL=https
24 | HTTP_PORT=80
25 | HTTPS_PORT=443
26 | HOST=ec2-54-235-229-141.compute-1.amazonaws.com
27 | ABS_PATH=/linkeddatahub/
28 |
29 |

Dataspace URIs need to relative to the system base URI in order to be reachable.

30 |
"""^^rdf:XMLLiteral . 31 | -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/create-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "Create data" ; 13 | dct:description "How to create documents, content, and instances" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

How to create documents, content, and instances

20 |

Documents are RDF documents stored in the application's dataset. They contain descriptions of resources, e.g. instances created by the user, imported from files, or loaded from Linked Data.

21 |

Each document can have content, which is a chain (RDF list) of URI resources and XHTML literals.

22 |
"""^^rdf:XMLLiteral . 23 | 24 | <#select-children> a ldh:Object ; 25 | rdf:value ldh:ChildrenView . 26 | -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/create-data/create-documents.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Create documents" ; 12 | dct:description "Learn how to create container and item documents" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Learn how to create container and item documents

18 |

19 | 20 |

21 |

To create a container document (which can have children documents) with a custom URL, follow these steps:

22 |
23 | 27 |
28 |
29 |
30 |
    31 |
  1. Click the Create dropdown in the top-left corner and select Container. This will open a new form.
  2. 32 |
  3. Fill out the mandatory Container fields in the form: 33 |
    34 |
    Title
    35 |
    Enter Concepts
    36 |
    37 |
  4. 38 |
  5. To customize the container URL, click on the dropdown in the top-right corner of the form
  6. 39 |
  7. Replace the generated unique relative URI with concepts
  8. 40 |
  9. Click Save
  10. 41 |
42 |

See how below:

43 |

44 | 45 |

46 |
47 |
48 |
49 |
50 |

Replace owner_cert_password with the value of the corresponding secret and execute the following command:

51 |
create-container.sh \\
52 |   -b "https://localhost:4443/" \\
53 |   -f ./ssl/owner/cert.pem \\
54 |   -p "$owner_cert_password" \\
55 |   --title "Concepts" \\
56 |   --slug "concepts" \\
57 |   --parent "https://localhost:4443/"
58 |
59 |
60 |
61 |
62 |

A container titled Concepts should appear with the URI https://localhost:4443/concepts/.

63 |

Read more about document management.

64 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/create-data/create-resources.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Create instances" ; 12 | dct:description "Learn how to create of built-in and user-defined classes" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Learn how to create instances of built-in and user-defined classes

18 |

19 | 20 |

21 |

Built-in classes (such as Container, Item, SELECT etc.) ship with system ontologies in LinkedDataHub while user-defined classes come from ontologies imported by the user (see the user guide on changing the model on how to do that).

22 |

Note that in order to create class instances, you have to be in properties mode.

23 |
24 |

Built-in classes

25 |

To create instances of built-in classes, follow these steps:

26 |
    27 |
  1. Click the Create dropdown on the bottom of the page
  2. 28 |
  3. In the drop-down list that appears click on the menu item of the class you want to create an instance for. An editing form will open.
  4. 29 |
  5. Fill out the fields in the form that appears. The mandatory properties are rendered in bold, without providing their values you will not be able to save the instance form.
  6. 30 |
  7. Click Save
  8. 31 |
  9. In case there were errors such as missing or malformed values, an error message will be shown and the offending property and value will be highlighted. Fix them or you will not be able to save the instance form.
  10. 32 |
33 |

You will be redirected to the document of the newly created instance.

34 |
35 |
36 |

User-defined classes

37 |

To create instances of user-defined classes, follow these steps:

38 |
    39 |
  1. Click the Create dropdown on the bottom of the page
  2. 40 |
  3. Click on Instance in the drop-down list that appears. An editing form will open.
  4. 41 |
  5. In the resource of Type Instance, click on the Instance typeahead input, type the class name and select the class from the list
  6. 42 |
  7. Fill out the fields in the form that appears. The mandatory properties are rendered in bold, without providing their values you will not be able to save the instance form.
  8. 43 |
  9. Click Save
  10. 44 |
  11. In case there were errors such as missing or malformed values, an error message will be shown and the offending property and value will be highlighted. Fix them or you will not be able to save the instance form.
  12. 45 |
46 |

You will be redirected to the document of the newly created instance.

47 |
48 |

You can only create instances of classes that have constructors.

49 |
50 |
51 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/import-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | @prefix spin: . 9 | 10 | <> a dh:Container ; 11 | sioc:has_parent <..> ; 12 | dct:title "Import data" ; 13 | dct:description "How to import data into LinkedDataHub" ; 14 | rdf:_1 <#content> ; 15 | rdf:_2 <#select-children> . 16 | 17 | <#content> a ldh:XHTML ; 18 | rdf:value """
19 |

How to import data into LinkedDataHub

20 |
"""^^rdf:XMLLiteral . 21 | 22 | <#select-children> a ldh:Object ; 23 | rdf:value ldh:ChildrenView . 24 | -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/navigate-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Navigate data" ; 12 | dct:description "Navigate the document hierarchy, related results, and backlinks" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Navigate the document hierarchy, related results, and backlinks

18 |

19 | 20 |

21 |
22 |

Document tree

23 |

Document tree is a widget that enables quick overview of the application's document hierarchy. Each document is shown as a node in the tree; container documents 24 | can be expanded to reveal the children documents.

25 |

The widget can be accessed by sliding the mouse to the left edge of the screen (on responsive layouts, it is always visible).

26 |

27 | Document tree 28 |

29 |
30 |
31 | 32 |

Backlinks are shown in the right-side navigation for every resource in property layout mode. 33 | They display a list of resources which have properties with the current resource as the object.

34 |
35 |
36 | 37 |
38 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/query-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Query data" ; 12 | dct:description "Learn how to query application data with SPARQL, store queries and charts" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

This guide describes how the application dataset can be queried using SPARQL.

18 |

The end-user application dataset can be queried using SPARQL 1.1 19 | endpoint, which is available via link in the navigation bar.

20 |

All forms of SPARQL queries are allowed; SPARQL updates are not allowed. A result limit might apply.

21 |

For DESCRIBE and CONSTRUCT results, it is possible to switch the 22 | layout mode using a button above to the results.

23 |

24 | SPARQL endpoint 25 |

26 |
27 |

Saving queries

28 |

If you want to save the query string which is currently in the editor, click the Save button underneath the editor form. A document creation form will open where the query 29 | string will be filled in, you only need to enter the titles of the query and its document. You can then access the query by navigating to the query container via the dropdown in the 30 | breadcrumb bar.

31 |

You will not be able to save invalid query strings.

32 |
33 |
34 |

Saving charts

35 |

The SPARQL editor includes an interactive chart pane which can be used to visualize the query results. You can change the chart type, select its category and one or more series.

36 |

The chart pane supports both graph query (CONSTRUCT, DESCRIBE) and result set query (SELECT, ASK) results. For graph results, the category and series are 37 | rendered from resource properties; for result sets, they are rendered from variable names.

38 |

If you want to save the chart with properties which are currently selected, click the Save button underneath the chart pane. That will open two document creation forms: one for 39 | the query, and the second one for the chart (as the chart depends on the query). The query string and chart properties will be filled in, you only need to 40 | enter the titles of the query and the chart and their document. You can then access the chart by navigating to the chart container via the dropdown in the 41 | breadcrumb bar.

42 |

You will not be able to save invalid query strings.

43 |
44 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/search-data.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Search data" ; 12 | dct:description "Search for resources using text keywords" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Search for resources using text keywords

18 |
19 | 20 |

You can lookup resources by typing a phrase (it does not have to be complete, start with a few letters) into the input in the navigation bar.

21 |

A dropdown list will appear if there are any matches. Use up/down keys or mouse click to select one of the results, and you will be redirected to its document.

22 |

The matching is done by looking for substrings using SPARQL regex() in common literal properties such as dct:title, rdfs:label, foaf:name, 23 | sioc:content etc. You can find the exact query in Queries / Select labelled.

24 |

The same widget is used for autocomplete inputs in the create/edit forms.

25 |

26 | SPARQL endpoint 27 |

28 |
29 |
30 | 31 |

You can use SPARQL to query data from the application's SPARQL service.

32 |
33 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/user-guide/upload-file.ttl: -------------------------------------------------------------------------------- 1 | @prefix def: . 2 | @prefix ldh: . 3 | @prefix rdf: . 4 | @prefix xsd: . 5 | @prefix dh: . 6 | @prefix dct: . 7 | @prefix sioc: . 8 | 9 | <> a dh:Item ; 10 | sioc:has_container <..> ; 11 | dct:title "Upload file" ; 12 | dct:description "Learn how to upload files to LinkedDataHub" ; 13 | rdf:_1 <#content> . 14 | 15 | <#content> a ldh:XHTML ; 16 | rdf:value """
17 |

Learn how to upload files to LinkedDataHub

18 |
19 | 23 |
24 |
25 |
26 |
    27 |
  1. Click the Create dropdown on the bottom of the page
  2. 28 |
  3. Click on File in the drop-down list that appears
  4. 29 |
  5. Fill out the mandatory File fields in the form: 30 |
    31 |
    FileName
    32 |
    Select file from your filesystem
    33 |
    Title
    34 |
    Enter file title
    35 |
    Title
    36 |
    Enter document title
    37 |
    38 |
  6. 39 |
  7. Click Save
  8. 40 |
41 |

See how below:

42 |

43 | 44 |

45 |
46 |
47 |
48 |
49 |

Replace owner_cert_password with its value from the .env file and execute the following command:

50 |
create-file.sh \\
51 | -b "https://localhost:4443/" \\
52 | -f ./ssl/owner/cert.pem \\
53 | -p "$owner_cert_password" \\
54 | --title "$title" \\
55 | --file "$filename" \\
56 | --file-content-type "$content_type"
57 |
58 |
59 |
60 |
61 |
"""^^rdf:XMLLiteral . -------------------------------------------------------------------------------- /linkeddatahub/docs/validate-documents.sh: -------------------------------------------------------------------------------- 1 | find . -name '*.ttl' -type f -exec echo {} \; -exec trig --validate {} \; --------------------------------------------------------------------------------