Using apl_in_the_shell which makes the APL language command line friendly.
The answer using the sample data is 11.
Here is the full solution:
| PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
| PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
| PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | |
| prefix bfo: <http://purl.obolibrary.org/obo/> | |
| prefix cco: <https://www.commoncoreontologies.org/> | |
| prefix owl: <http://www.w3.org/2002/07/owl#> | |
| select * where { | |
| ?s a owl:ObjectProperty . | |
| # ?s a owl:DatatypeProperty . | |
| # ?s a owl:Class . |
| # APL | |
| v←'RAFT DATA PLATFORM' | |
| f←1∘⌽⍤(0 0∘,)⍤(' '∘(3∧/≠)) | |
| f v | |
| 0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 | |
| ⍉v(,⍤0)f v | |
| R A F T D A T A P L A T F O R M | |
| 0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 |
| ⎕IO←0 | |
| m←2 3 4 3⍴⍳72 | |
| ⍝ the goal is to reproduce this numpy broadcasting behavior in APL | |
| ⍝ m/m.sum(axis=0, keepdims=True) | |
| normalize_and_keepdims←{⍵÷(⍴⍵)⍴(⍺⌷⍴⍵)/[(0⌈⍺-1)]+/[⍺]⍵} | |
| 0 normalize_and_keepdims m | |
| 0 0.02631578947 0.05 |
| @prefix : <http://example.org/pizza#> . | |
| @prefix owl: <http://www.w3.org/2002/07/owl#> . | |
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
| @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
| :hasTopping a owl:ObjectProperty . | |
| :VegetablePizza a owl:Class ; | |
| owl:equivalentClass [ |
| # using https://github.com/justin2004/apl_in_the_shell | |
| justin@parens:~/Downloads$ curl "https://en.wikipedia.org/w/api.php?action=query&prop=extracts&explaintext&format=json&titles=St._Louis" | jq '.query.pages[].extract' | apl '{a←{⍺,≢⍵}⌸⎕C∊⍵⋄a⌷⍨⊂⍒⌽a}' - | |
| 1956 | |
| e 1119 | |
| t 915 | |
| i 844 | |
| s 781 | |
| a 735 |
| { | |
| "openapi": "3.0.3", | |
| "info": { | |
| "title": "News API", | |
| "version": "1.0.0", | |
| "description": "Simple OpenAPI spec for /everything endpoint" | |
| }, | |
| "servers": [ | |
| { | |
| "url": "https://newsapi.org" |
| name | height | |
|---|---|---|
| bob | 213 | |
| fred | 41 |
Using apl_in_the_shell which makes the APL language command line friendly.
The answer using the sample data is 11.
Here is the full solution:
| SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |
| optional {?p ^(wikibase:claim|wikibase:directClaim|wikibase:statementProperty|wikibase:qualifierValue|wikibase:qualifier) ?pEntity} |
| # first download https://dlcdn.apache.org/jena/binaries/apache-jena-5.1.0.zip | |
| # then unzip it | |
| % mkdir /tmp/db1 | |
| % ls ~/Downloads/labels.ttl | |
| /Users/justin/Downloads/labels.ttl | |
| % ~/Downloads/apache-jena-5.1.0/bin/tdb2.tdbloader --loader=parallel --loc /tmp/db1 ~/Downloads/labels.ttl | |
| 11:52:38 INFO loader :: Loader = LoaderParallel | |
| 11:52:38 INFO loader :: Start: /Users/justin/Downloads/labels.ttl | |
| 11:52:38 INFO loader :: Finished: /Users/justin/Downloads/labels.ttl: 5 tuples in 0.11s (Avg: 46) |