https://wiki.bitplan.com/api.php?action=feedcontributions&user=Wf&feedformat=atom
BITPlan Wiki - User contributions [en]
2024-03-28T17:16:22Z
User contributions
MediaWiki 1.35.5
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18468
PageCacheTest
2024-03-28T03:48:54Z
<p>Wf: modified by testCacheRefesh at2024-03-28T03:48:53Z</p>
<hr />
<div>2024-03-28T03:48:53Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18467
PageCacheTest
2024-03-27T03:48:56Z
<p>Wf: modified by testCacheRefesh at2024-03-27T03:48:56Z</p>
<hr />
<div>2024-03-27T03:48:56Z</div>
Wf
https://wiki.bitplan.com/index.php?title=DEXPI&diff=18466
DEXPI
2024-03-26T17:58:18Z
<p>Wf: </p>
<hr />
<div>* https://dexpi.org/wp-content/uploads/2020/09/DEXPI-PID-Specification-1.3.pdf<br />
* https://github.com/ProteusXML<br />
<br />
= Computer readable version ? = <br />
prompt: is there a computer readable version of the DEXPI specification e.g. in XMI format?<br />
'''ChatGPT'''<br />
<br />
Yes, there is a computer-readable version of the DEXPI specification available in XMI format. The DEXPI+ Specification 1.0 Release Candidate provides materials that include an Enterprise Architect file containing the UML model, XMI 1.1 and XML 2.1 versions of the UML model, along with XML and AML files as demonstrations of possible serialization formats<br />
<br />
.<br />
<br />
DEXPI focuses on developing and promoting a data exchange standard for the process industry, with its specifications defining an information model for various diagrams and components within the industry, such as Piping and Instrumentation Diagrams (P&IDs) and Process Flow Diagrams (PFDs). The specifications also include mappings to the exchange format Proteus Schema<br />
. For practical implementation, the DEXPI specification provides detailed guidelines on how classes from the conceptual model are mapped to XML tag names defined by the Proteus Schema, with examples on how instances of these classes are serialized as XML elements<br />
<br />
.<br />
<br />
For more detailed information on the DEXPI+ Specification 1.0 Release Candidate and access to the XMI format and other related files, you can visit the official DEXPI website.<br />
<br />
== Files ==<br />
https://nextcloud.dexpi.org/s/4aR4yFKWtYPjDdX</div>
Wf
https://wiki.bitplan.com/index.php?title=DEXPI&diff=18465
DEXPI
2024-03-26T17:46:41Z
<p>Wf: </p>
<hr />
<div>* https://dexpi.org/wp-content/uploads/2020/09/DEXPI-PID-Specification-1.3.pdf<br />
* https://github.com/ProteusXML<br />
<br />
= Computer readable version ? = <br />
prompt: is there a computer readable version of the DEXPI specification e.g. in XMI format?<br />
'''ChatGPT'''<br />
<br />
Yes, there is a computer-readable version of the DEXPI specification available in XMI format. The DEXPI+ Specification 1.0 Release Candidate provides materials that include an Enterprise Architect file containing the UML model, XMI 1.1 and XML 2.1 versions of the UML model, along with XML and AML files as demonstrations of possible serialization formats<br />
<br />
.<br />
<br />
DEXPI focuses on developing and promoting a data exchange standard for the process industry, with its specifications defining an information model for various diagrams and components within the industry, such as Piping and Instrumentation Diagrams (P&IDs) and Process Flow Diagrams (PFDs). The specifications also include mappings to the exchange format Proteus Schema<br />
. For practical implementation, the DEXPI specification provides detailed guidelines on how classes from the conceptual model are mapped to XML tag names defined by the Proteus Schema, with examples on how instances of these classes are serialized as XML elements<br />
<br />
.<br />
<br />
For more detailed information on the DEXPI+ Specification 1.0 Release Candidate and access to the XMI format and other related files, you can visit the official DEXPI website.</div>
Wf
https://wiki.bitplan.com/index.php?title=DEXPI&diff=18464
DEXPI
2024-03-26T17:35:47Z
<p>Wf: </p>
<hr />
<div>* https://dexpi.org/wp-content/uploads/2020/09/DEXPI-PID-Specification-1.3.pdf<br />
* https://github.com/ProteusXML</div>
Wf
https://wiki.bitplan.com/index.php?title=DEXPI&diff=18463
DEXPI
2024-03-26T17:34:13Z
<p>Wf: Created page with "https://dexpi.org/wp-content/uploads/2020/09/DEXPI-PID-Specification-1.3.pdf"</p>
<hr />
<div>https://dexpi.org/wp-content/uploads/2020/09/DEXPI-PID-Specification-1.3.pdf</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18462
PageCacheTest
2024-03-26T03:48:54Z
<p>Wf: modified by testCacheRefesh at2024-03-26T03:48:54Z</p>
<hr />
<div>2024-03-26T03:48:54Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18461
PageCacheTest
2024-03-25T11:07:08Z
<p>Wf: modified by testCacheRefesh at2024-03-25T11:07:08Z</p>
<hr />
<div>2024-03-25T11:07:08Z</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18460
Py ez wikidata
2024-03-20T15:06:08Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.2.2<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-20<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=PyGenericSpreadSheet&diff=18459
PyGenericSpreadSheet
2024-03-19T16:13:17Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=PyGenericSpreadSheet<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=PyGenericSpreadSheet<br />
|url=https://github.com/WolfgangFahl/PyGenericSpreadSheet/<br />
|version=0.3.1<br />
|description=python API providing generic Access to Spreadsheet backends<br />
|date=2024-03-19<br />
|since=2022-01-29<br />
}}</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18458
PageCacheTest
2024-03-19T05:58:52Z
<p>Wf: modified by testCacheRefesh at2024-03-19T05:58:51Z</p>
<hr />
<div>2024-03-19T05:58:51Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PyOnlineSpreadSheetEditing&diff=18457
PyOnlineSpreadSheetEditing
2024-03-18T14:17:23Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=pyOnlineSpreadSheetEditing<br />
|state=active<br />
|owner=Wolfgang Fahl<br />
|title=pyOnlineSpreadSheetEditing<br />
|description=python Online SpreadSheet Editing tool with configurable enhancer/importer and check phase<br />
|url=https://github.com/WolfgangFahl/pyOnlineSpreadSheetEditing<br />
|version=0.3.0<br />
|date=2024-03-18<br />
|since=2021-12-12<br />
|storemode=property<br />
}}<br />
<br />
= Semantic MediaWiki Use Case =<br />
== SMWCon Fall 2021 Presentation ==<br />
<youtube>0zD4cSRDj-Q<</youtube><br />
== Workflow ==<br />
<graphviz format='svg'><br />
digraph spreadsheetediting {<br />
src [ label="source wiki" shape="box" ] <br />
target [ label="target wiki" shape="box" ] <br />
preview [ label="preview wiki" shape="box" ] <br />
wikiquery [ label="wikiquery" shape="octagon" ]<br />
Query1 [ label="ask query for 1 side of relation" ]<br />
QueryN [ label="ask query for n side of relation" ]<br />
QueryCheck [ label="check plausibility of results" ]<br />
Query1 -> wikiquery [ label="ask" ] <br />
QueryN -> wikiquery [ label="ask" ] <br />
wikiquery -> QueryCheck [ label="LoD 1" ] <br />
wikiquery -> QueryCheck [ label="LoD n" ] <br />
src -> wikiquery<br />
<br />
QueryCheck->Pre<br />
subgraph cluster_service {<br />
label="SpreadSheet Editing Service" <br />
Edit [ label="Spreadsheet Editor" ]<br />
Pre [ label="Enhancement" ]<br />
Post [ label="Result Check" ]<br />
}<br />
Pre-> Edit<br />
Edit -> Post<br />
Post -> Publish <br />
Publish -> target [ label="wikipush" ]<br />
Preview -> preview [ label="wikipush" ]<br />
Post-> Preview [ label ="optional" ]<br />
<br />
}<br />
</graphviz><br />
= Steps =<br />
#Queries - multiple ones potentially via RESTful call giving e.g. CSV/JSON ... result , Simple Example: CSV export<br />
#Enhance data - multiple RESTful calls (optional)<br />
#manual check and edit with Spreadsheet<br />
#Final data check - multiple RESTful calls (optional)<br />
#Store data e.g. Wiki / Wikidata ... Simple Example: CSV import<br />
<br />
= Issues =</div>
Wf
https://wiki.bitplan.com/index.php?title=PyGenericSpreadSheet&diff=18456
PyGenericSpreadSheet
2024-03-18T11:37:58Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=PyGenericSpreadSheet<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=PyGenericSpreadSheet<br />
|url=https://github.com/WolfgangFahl/PyGenericSpreadSheet/<br />
|version=0.3.0<br />
|description=python API providing generic Access to Spreadsheet backends<br />
|date=2024-03-18<br />
|since=2022-01-29<br />
}}<br />
=tickets=</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18455
Py ez wikidata
2024-03-18T11:35:53Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.2.1<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-07<br />
|since=2024-03-18<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=PyCEURmake&diff=18454
PyCEURmake
2024-03-16T16:37:37Z
<p>Wf: /* Model */</p>
<hr />
<div>=OsProject=<br />
{{OsProject<br />
|id=pyCEURmake<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=pyCEURmake<br />
|url=https://github.com/WolfgangFahl/pyCEURmake<br />
|version=0.4.0<br />
|description=CEUR-WS Volume Browser and utilities<br />
|date=2024-03-10<br />
|since=2022-08-14<br />
}}<br />
{{pip|pyCEURmake}}<br />
<br />
= Usage =<br />
<source lang='bash'><br />
ceur-ws -h<br />
usage: ceur-ws [-h] [-a] [-d] [--host HOST] [-l] [--port PORT] [-s] [-V]<br />
<br />
Copyright 2022 contributors. All rights reserved.<br />
<br />
Licensed under the Apache License 2.0<br />
http://www.apache.org/licenses/LICENSE-2.0<br />
<br />
Distributed on an "AS IS" basis without warranties<br />
or conditions of any kind, either express or implied.<br />
<br />
options:<br />
-h, --help show this help message and exit<br />
-a, --about show about info [default: False]<br />
-d, --debug show debug info [default: False]<br />
--host HOST the host to serve / listen from [default: fix.bitplan.com]<br />
-l, --list list all volumes [default: False]<br />
--port PORT the port to serve from [default: 9998]<br />
-s, --serve start webserver [default: False]<br />
-V, --version show program's version number and exit<br />
</source><br />
<br />
== About ==<br />
Opens browser with this page<br />
<source lang='bash' highlight='1'><br />
ceur-ws --about<br />
</source><br />
== List ==<br />
List volumes<br />
<source lang='bash' highlight='1'><br />
ceur-ws --list | tail<br />
Vol-3336<br />
Vol-3337<br />
Vol-3338<br />
Vol-3339<br />
Vol-3340<br />
Vol-3341<br />
Vol-3342<br />
Vol-3343<br />
Vol-3344<br />
Vol-3345<br />
</source><br />
<br />
== Serve ==<br />
<source lang='bash' highlight='1'><br />
ceur-ws --serve<br />
</source><br />
start local CEUR-WS browser see also public demo [http://ceur-ws-browser.bitplan.com CEUR-WS browser at http://ceur-ws-browser.bitplan.com]<br />
<br />
== Version ==<br />
shows current Version<br />
<source lang='bash' highlight='1'><br />
ceur-ws --version<br />
ceur-ws (v0.1.0,2023-02-20)<br />
</source><br />
= Model =<br />
<uml><br />
hide circle<br />
package dblp {<br />
' Define the classes<br />
class Scholar {<br />
-dblp_author_id: str<br />
-label: Optional[str]<br />
-wikidata_id: Optional[str]<br />
-orcid_id: Optional[str]<br />
-gnd_id: Optional[str]<br />
}<br />
<br />
class Paper {<br />
-dblp_publication_id: str<br />
-dblp_proceeding_id: str<br />
-volume_number: int<br />
-title: str<br />
-pdf_id: Optional[str]<br />
}<br />
<br />
class Proceeding {<br />
-dblp_publication_id: str<br />
-volume_number: int<br />
-title: str<br />
-dblp_event_id: Optional[str]<br />
}<br />
<br />
class Authorship {<br />
}<br />
<br />
' Define relationships<br />
Authorship "n authorships" - Scholar: author<br />
Authorship "n authorships" - Paper: paper<br />
Proceeding "1" -- "0..*" Paper : papers<br />
Proceeding "1" -- "0..*" Scholar : editors<br />
}<br />
</uml></div>
Wf
https://wiki.bitplan.com/index.php?title=PyCEURmake&diff=18453
PyCEURmake
2024-03-16T13:19:09Z
<p>Wf: /* Version */</p>
<hr />
<div>=OsProject=<br />
{{OsProject<br />
|id=pyCEURmake<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=pyCEURmake<br />
|url=https://github.com/WolfgangFahl/pyCEURmake<br />
|version=0.4.0<br />
|description=CEUR-WS Volume Browser and utilities<br />
|date=2024-03-10<br />
|since=2022-08-14<br />
}}<br />
{{pip|pyCEURmake}}<br />
<br />
= Usage =<br />
<source lang='bash'><br />
ceur-ws -h<br />
usage: ceur-ws [-h] [-a] [-d] [--host HOST] [-l] [--port PORT] [-s] [-V]<br />
<br />
Copyright 2022 contributors. All rights reserved.<br />
<br />
Licensed under the Apache License 2.0<br />
http://www.apache.org/licenses/LICENSE-2.0<br />
<br />
Distributed on an "AS IS" basis without warranties<br />
or conditions of any kind, either express or implied.<br />
<br />
options:<br />
-h, --help show this help message and exit<br />
-a, --about show about info [default: False]<br />
-d, --debug show debug info [default: False]<br />
--host HOST the host to serve / listen from [default: fix.bitplan.com]<br />
-l, --list list all volumes [default: False]<br />
--port PORT the port to serve from [default: 9998]<br />
-s, --serve start webserver [default: False]<br />
-V, --version show program's version number and exit<br />
</source><br />
<br />
== About ==<br />
Opens browser with this page<br />
<source lang='bash' highlight='1'><br />
ceur-ws --about<br />
</source><br />
== List ==<br />
List volumes<br />
<source lang='bash' highlight='1'><br />
ceur-ws --list | tail<br />
Vol-3336<br />
Vol-3337<br />
Vol-3338<br />
Vol-3339<br />
Vol-3340<br />
Vol-3341<br />
Vol-3342<br />
Vol-3343<br />
Vol-3344<br />
Vol-3345<br />
</source><br />
<br />
== Serve ==<br />
<source lang='bash' highlight='1'><br />
ceur-ws --serve<br />
</source><br />
start local CEUR-WS browser see also public demo [http://ceur-ws-browser.bitplan.com CEUR-WS browser at http://ceur-ws-browser.bitplan.com]<br />
<br />
== Version ==<br />
shows current Version<br />
<source lang='bash' highlight='1'><br />
ceur-ws --version<br />
ceur-ws (v0.1.0,2023-02-20)<br />
</source><br />
= Model =<br />
<uml><br />
hide circle<br />
package dblp {<br />
' Define the classes<br />
class Scholar {<br />
-dblp_author_id: str<br />
-label: Optional[str]<br />
-wikidata_id: Optional[str]<br />
-orcid_id: Optional[str]<br />
-gnd_id: Optional[str]<br />
}<br />
<br />
class Paper {<br />
-dblp_publication_id: str<br />
-dblp_proceeding_id: str<br />
-volume_number: int<br />
-title: str<br />
-pdf_id: Optional[str]<br />
}<br />
<br />
class Proceeding {<br />
-dblp_publication_id: str<br />
-volume_number: int<br />
-title: str<br />
-dblp_event_id: Optional[str]<br />
-editors: Optional[List[DblpScholar]]<br />
}<br />
<br />
class Authorship {<br />
}<br />
<br />
' Define relationships<br />
Authorship "n authorships" - Scholar: author<br />
Authorship "n authorships" - Paper: paper<br />
Proceeding "1" -- "0..*" Paper : papers<br />
Proceeding "1" -- "0..*" Scholar : editors<br />
}<br />
</uml></div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18452
PageCacheTest
2024-03-15T19:07:03Z
<p>Wf: modified by testCacheRefesh at2024-03-15T19:07:03Z</p>
<hr />
<div>2024-03-15T19:07:03Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18451
PageCacheTest
2024-03-14T03:48:57Z
<p>Wf: modified by testCacheRefesh at2024-03-14T03:48:57Z</p>
<hr />
<div>2024-03-14T03:48:57Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18450
PageCacheTest
2024-03-13T03:48:56Z
<p>Wf: modified by testCacheRefesh at2024-03-13T03:48:56Z</p>
<hr />
<div>2024-03-13T03:48:56Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18449
PageCacheTest
2024-03-12T03:48:52Z
<p>Wf: modified by testCacheRefesh at2024-03-12T03:48:52Z</p>
<hr />
<div>2024-03-12T03:48:52Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18448
PageCacheTest
2024-03-11T18:46:15Z
<p>Wf: modified by testCacheRefesh at2024-03-11T18:46:15Z</p>
<hr />
<div>2024-03-11T18:46:15Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18447
PageCacheTest
2024-03-10T16:05:02Z
<p>Wf: modified by testCacheRefesh at2024-03-10T16:05:02Z</p>
<hr />
<div>2024-03-10T16:05:02Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PyCEURmake&diff=18446
PyCEURmake
2024-03-10T15:44:30Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
{{OsProject<br />
|id=pyCEURmake<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=pyCEURmake<br />
|url=https://github.com/WolfgangFahl/pyCEURmake<br />
|version=0.4.0<br />
|description=CEUR-WS Volume Browser and utilities<br />
|date=2024-03-10<br />
|since=2022-08-14<br />
}}<br />
{{pip|pyCEURmake}}<br />
<br />
= Usage =<br />
<source lang='bash'><br />
ceur-ws -h<br />
usage: ceur-ws [-h] [-a] [-d] [--host HOST] [-l] [--port PORT] [-s] [-V]<br />
<br />
Copyright 2022 contributors. All rights reserved.<br />
<br />
Licensed under the Apache License 2.0<br />
http://www.apache.org/licenses/LICENSE-2.0<br />
<br />
Distributed on an "AS IS" basis without warranties<br />
or conditions of any kind, either express or implied.<br />
<br />
options:<br />
-h, --help show this help message and exit<br />
-a, --about show about info [default: False]<br />
-d, --debug show debug info [default: False]<br />
--host HOST the host to serve / listen from [default: fix.bitplan.com]<br />
-l, --list list all volumes [default: False]<br />
--port PORT the port to serve from [default: 9998]<br />
-s, --serve start webserver [default: False]<br />
-V, --version show program's version number and exit<br />
</source><br />
<br />
== About ==<br />
Opens browser with this page<br />
<source lang='bash' highlight='1'><br />
ceur-ws --about<br />
</source><br />
== List ==<br />
List volumes<br />
<source lang='bash' highlight='1'><br />
ceur-ws --list | tail<br />
Vol-3336<br />
Vol-3337<br />
Vol-3338<br />
Vol-3339<br />
Vol-3340<br />
Vol-3341<br />
Vol-3342<br />
Vol-3343<br />
Vol-3344<br />
Vol-3345<br />
</source><br />
<br />
== Serve ==<br />
<source lang='bash' highlight='1'><br />
ceur-ws --serve<br />
</source><br />
start local CEUR-WS browser see also public demo [http://ceur-ws-browser.bitplan.com CEUR-WS browser at http://ceur-ws-browser.bitplan.com]<br />
<br />
== Version ==<br />
shows current Version<br />
<source lang='bash' highlight='1'><br />
ceur-ws --version<br />
ceur-ws (v0.1.0,2023-02-20)<br />
</source></div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18445
PageCacheTest
2024-03-09T03:49:02Z
<p>Wf: modified by testCacheRefesh at2024-03-09T03:49:01Z</p>
<hr />
<div>2024-03-09T03:49:01Z</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18444
Py ez wikidata
2024-03-08T12:32:19Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.2.0<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-07<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18443
PageCacheTest
2024-03-08T03:48:56Z
<p>Wf: modified by testCacheRefesh at2024-03-08T03:48:56Z</p>
<hr />
<div>2024-03-08T03:48:56Z</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18442
Py ez wikidata
2024-03-07T06:27:04Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.1.5<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-06<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18441
PageCacheTest
2024-03-07T03:51:04Z
<p>Wf: modified by testCacheRefesh at2024-03-07T03:51:03Z</p>
<hr />
<div>2024-03-07T03:51:03Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18440
PageCacheTest
2024-03-06T03:51:23Z
<p>Wf: modified by testCacheRefesh at2024-03-06T03:51:23Z</p>
<hr />
<div>2024-03-06T03:51:23Z</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18439
Py ez wikidata
2024-03-05T07:16:45Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.1.2<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-05<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18438
PageCacheTest
2024-03-05T03:49:01Z
<p>Wf: modified by testCacheRefesh at2024-03-05T03:49:01Z</p>
<hr />
<div>2024-03-05T03:49:01Z</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18437
Py ez wikidata
2024-03-04T20:22:09Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.1.1<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-04<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=Nam_June_Paik&diff=18436
Nam June Paik
2024-03-04T09:25:59Z
<p>Wf: </p>
<hr />
<div><br />
''Wenn zu perfekt, liebe Gott böse!'' (1993)<br />
https://www.welt.de/print-welt/article401089/Die-Irren-sind-los.html<br />
<br />
''If you are too perfect, god gets angry at you''<br />
* https://noemalab.eu/ideas/interview/interview-with-nam-june-paik/<br />
[https://www.wikidata.org/wiki/Q158056 Wikidata item for Nam June Paik]</div>
Wf
https://wiki.bitplan.com/index.php?title=Nam_June_Paik&diff=18435
Nam June Paik
2024-03-04T09:23:05Z
<p>Wf: </p>
<hr />
<div><br />
<br />
''If you are too perfect, god gets angry at you''<br />
* https://noemalab.eu/ideas/interview/interview-with-nam-june-paik/<br />
[https://www.wikidata.org/wiki/Q158056 Wikidata item for Nam June Paik]</div>
Wf
https://wiki.bitplan.com/index.php?title=Nam_June_Paik&diff=18434
Nam June Paik
2024-03-04T09:22:42Z
<p>Wf: </p>
<hr />
<div>https://www.wikidata.org/wiki/Q158056<br />
<br />
''If you are too perfect, god gets angry at you''<br />
* https://noemalab.eu/ideas/interview/interview-with-nam-june-paik/</div>
Wf
https://wiki.bitplan.com/index.php?title=Nam_June_Paik&diff=18433
Nam June Paik
2024-03-04T09:21:28Z
<p>Wf: </p>
<hr />
<div>''If you are too perfect, god gets angry at you''<br />
* https://noemalab.eu/ideas/interview/interview-with-nam-june-paik/</div>
Wf
https://wiki.bitplan.com/index.php?title=Nam_June_Paik&diff=18432
Nam June Paik
2024-03-04T09:21:02Z
<p>Wf: Created page with "* https://noemalab.eu/ideas/interview/interview-with-nam-june-paik/"</p>
<hr />
<div>* https://noemalab.eu/ideas/interview/interview-with-nam-june-paik/</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18431
PageCacheTest
2024-03-04T03:48:55Z
<p>Wf: modified by testCacheRefesh at2024-03-04T03:48:55Z</p>
<hr />
<div>2024-03-04T03:48:55Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18430
PageCacheTest
2024-03-03T03:48:57Z
<p>Wf: modified by testCacheRefesh at2024-03-03T03:48:57Z</p>
<hr />
<div>2024-03-03T03:48:57Z</div>
Wf
https://wiki.bitplan.com/index.php?title=PyLoDStorage&diff=18429
PyLoDStorage
2024-03-02T12:46:33Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
{{OsProject<br />
|id=PyLodStorage<br />
|owner=Wolfgang Fahl<br />
|title=python List of Dict (Table) Storage library<br />
|url=https://github.com/WolfgangFahl/pyLodStorage<br />
|version=0.9.0<br />
|date=2024-03-02<br />
|since=2020-09-10<br />
|storemode=property<br />
}}<br />
<br />
see also <br />
* {{Link|target=DgraphAndWeaviateTest}}<br />
* {{Link|target=Geograpy}}<br />
* {{Link|target=ProceedingsTitleParser}}<br />
<br />
== List of Dicts = Table ==<br />
a list of dicts(Hashtables) in python can be interpreted as Table which is suitable to <br />
# be stored in a relational database like sqlite3<br />
# represented as JSON, CSV or example<br />
# edited with a [https://github.com/WolfgangFahl/pyOnlineSpreadSheetEditing Spreadsheet editor]<br />
<br />
== Royals example ==<br />
<source lang='python'><br />
@staticmethod<br />
def getRoyals():<br />
listOfDicts=[<br />
{'name': 'Elizabeth Alexandra Mary Windsor', 'born': Sample.dob('1926-04-21'), 'numberInLine': 0, 'wikidataurl': 'https://www.wikidata.org/wiki/Q9682' },<br />
{'name': 'Charles, Prince of Wales', 'born': Sample.dob('1948-11-14'), 'numberInLine': 1, 'wikidataurl': 'https://www.wikidata.org/wiki/Q43274' },<br />
{'name': 'George of Cambridge', 'born': Sample.dob('2013-07-22'), 'numberInLine': 3, 'wikidataurl': 'https://www.wikidata.org/wiki/Q1359041'},<br />
{'name': 'Harry Duke of Sussex', 'born': Sample.dob('1984-09-15'), 'numberInLine': 6, 'wikidataurl': 'https://www.wikidata.org/wiki/Q152316'}<br />
]<br />
today=date.today()<br />
for person in listOfDicts:<br />
born=person['born']<br />
age=(today - born).days / 365.2425<br />
person['age']=age<br />
person['ofAge']=age>=18<br />
person['lastmodified']=datetime.now()<br />
return listOfDicts<br />
</source><br />
<br />
The above list of dict can be stored in a Person table with the following structure:<br />
<br />
<uml><br />
package Royals {<br />
class Person << Entity >> {<br />
age : FLOAT <br />
born : DATE <br />
lastmodified : TIMESTAMP <br />
name : TEXT <<PK>><br />
numberInLine : INTEGER <br />
ofAge : BOOLEAN <br />
wikidataurl : TEXT <br />
}<br />
}<br />
</uml><br />
<br />
{{pip|pyLodStorage}}<br />
<br />
= SQL =<br />
The idea is to derive the necessary DDL and SQL command automatically:<br />
<source lang='sql'><br />
CREATE TABLE Family(name TEXT PRIMARY KEY,country TEXT,lastmodified TIMESTAMP)<br />
INSERT INTO Family (name,country,lastmodified) values (:name,:country,:lastmodified)<br />
</source><br />
and use them via simple API<br />
<source lang='python'><br />
from lodstorage.sample import Sample<br />
from lodstorage.sql import SQLDB, EntityInfo<br />
<br />
listOfRecords=Sample.getRoyals()<br />
sqlDB=SQLDB()<br />
entityName='Person'<br />
primaryKey='name'<br />
entityInfo=self.sqlDB.createTable(listOfRecords[:10],entityName,primaryKey)<br />
sqlDB.store(listOfRecords,entityInfo)<br />
resultList=self.sqlDB.queryAll(entityInfo)<br />
</source><br />
<br />
The resultList will be the same as the original listOfRecords.<br />
<br />
= JSON =<br />
Wrap the royals example into a JSONAble class and test using that class for "round-trip" JSON storage:<br />
<source lang='python'><br />
...<br />
class Royals(JSONAble):<br />
def __init__(self,load=False):<br />
if load:<br />
self.royals=Sample.getRoyals()<br />
else:<br />
self.royals=None<br />
...<br />
def testRoyals(self):<br />
'''<br />
test Royals example<br />
'''<br />
royals1=Royals(load=True)<br />
self.assertEqual(4,len(royals1.royals))<br />
json=royals1.toJSON()<br />
print(json)<br />
types=Types.forClass(royals1, "royals")<br />
royals2=Royals()<br />
royals2.fromJson(json,types=types)<br />
self.assertEqual(4,len(royals2.royals))<br />
print(royals1.royals)<br />
print(royals2.royals)<br />
self.assertEqual(royals1.royals,royals2.royals)<br />
</source><br />
== JSON encoding ==<br />
<source lang='json'><br />
{<br />
"royals": [<br />
{<br />
"age": 94.42767476402663,<br />
"born": "1926-04-21",<br />
"lastmodified": "2020-09-23T09:44:48.661740",<br />
"name": "Elizabeth Alexandra Mary Windsor",<br />
"numberInLine": 0,<br />
"ofAge": true,<br />
"wikidataurl": "https://www.wikidata.org/wiki/Q9682"<br />
},<br />
{<br />
"age": 71.85910730542037,<br />
"born": "1948-11-14",<br />
"lastmodified": "2020-09-23T09:44:48.661747",<br />
"name": "Charles, Prince of Wales",<br />
"numberInLine": 1,<br />
"ofAge": true,<br />
"wikidataurl": "https://www.wikidata.org/wiki/Q43274"<br />
},<br />
{<br />
"age": 7.17331635830989,<br />
"born": "2013-07-22",<br />
"lastmodified": "2020-09-23T09:44:48.661748",<br />
"name": "George of Cambridge",<br />
"numberInLine": 3,<br />
"ofAge": false,<br />
"wikidataurl": "https://www.wikidata.org/wiki/Q1359041"<br />
},<br />
{<br />
"age": 36.022642490947796,<br />
"born": "1984-09-15",<br />
"lastmodified": "2020-09-23T09:44:48.661749",<br />
"name": "Harry Duke of Sussex",<br />
"numberInLine": 6,<br />
"ofAge": true,<br />
"wikidataurl": "https://www.wikidata.org/wiki/Q152316"<br />
}<br />
]<br />
}<br />
</source><br />
<br />
= Query Documentation =<br />
see also https://github.com/WolfgangFahl/pyLoDStorage/issues/46<br />
== Examples ==<br />
=== 15 Random substances with CAS number ===<br />
Wikidata SPARQL query showing the 15 random chemical substances with their CAS Number<br />
==== query ====<br />
<source lang='sparql'><br />
# List of 15 random chemical components with CAS-Number, formula and structure<br />
# see also https://github.com/WolfgangFahl/pyLoDStorage/issues/46<br />
# WF 2021-08-23<br />
SELECT ?substance ?substanceLabel ?formula ?structure ?CAS<br />
WHERE { <br />
?substance wdt:P31 wd:Q11173.<br />
?substance wdt:P231 ?CAS.<br />
?substance wdt:P274 ?formula.<br />
?substance wdt:P117 ?structure.<br />
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }<br />
}<br />
LIMIT 15<br />
<br />
</source><br />
<br />
[https://query.wikidata.org/#%23%20List%20of%2015%20random%20chemical%20components%20with%20CAS-Number%2C%20formula%20and%20structure%0A%23%20see%20also%20https%3A//github.com/WolfgangFahl/pyLoDStorage/issues/46%0A%23%20WF%202021-08-23%0ASELECT%20%3Fsubstance%20%3FsubstanceLabel%20%3Fformula%20%3Fstructure%20%3FCAS%0AWHERE%20%7B%20%0A%20%20%3Fsubstance%20wdt%3AP31%20wd%3AQ11173.%0A%20%20%3Fsubstance%20wdt%3AP231%20%3FCAS.%0A%20%20%3Fsubstance%20wdt%3AP274%20%3Fformula.%0A%20%20%3Fsubstance%20wdt%3AP117%20%20%3Fstructure.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D%0ALIMIT%2015%0A try it!]<br />
==== result ====<br />
{| class="wikitable" style="text-align: left;"<br />
|+ <!-- caption --><br />
|-<br />
! substance !! substanceLabel !! formula !! structure !! CAS<br />
|-<br />
| [http://www.wikidata.org/entity/Q32703 Q32703] || aminomethylpropanol || C₄H₁₁NO || [http://commons.wikimedia.org/wiki/Special:FilePath/2-amino-2-methyl-1-propanol.svg 2-amino-2-methyl-1-propanol.svg] || 124-68-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q32703 Q32703] || aminomethylpropanol || C₄H₁₁NO || [http://commons.wikimedia.org/wiki/Special:FilePath/Isobutanolamine%20t.png Isobutanolamine%20t.png] || 124-68-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q43656 Q43656] || cholesterol || C₂₇H₄₆O || [http://commons.wikimedia.org/wiki/Special:FilePath/Structural%20formula%20of%20cholesterol.svg Structural%20formula%20of%20cholesterol.svg] || 57-88-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q45143 Q45143] || fulminic acid || CHNO || [http://commons.wikimedia.org/wiki/Special:FilePath/Fulminezuur.png Fulminezuur.png] || 506-85-4<br />
|-<br />
| [http://www.wikidata.org/entity/Q49546 Q49546] || acetone || C₃H₆O || [http://commons.wikimedia.org/wiki/Special:FilePath/Acetone-2D-skeletal.svg Acetone-2D-skeletal.svg] || 67-64-1<br />
|-<br />
| [http://www.wikidata.org/entity/Q49546 Q49546] || acetone || C₃H₆O || [http://commons.wikimedia.org/wiki/Special:FilePath/Acetone-structural.png Acetone-structural.png] || 67-64-1<br />
|-<br />
| [http://www.wikidata.org/entity/Q52858 Q52858] || ethane || C₂H₆ || [http://commons.wikimedia.org/wiki/Special:FilePath/Ethan%20Keilstrich.svg Ethan%20Keilstrich.svg] || 74-84-0<br />
|-<br />
| [http://www.wikidata.org/entity/Q58356 Q58356] || amoxapine || C₁₇H₁₆ClN₃O || [http://commons.wikimedia.org/wiki/Special:FilePath/Amoxapine.svg Amoxapine.svg] || 14028-44-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q58713 Q58713] || clomipramine || C₁₉H₂₃ClN₂ || [http://commons.wikimedia.org/wiki/Special:FilePath/Clomipramine.svg Clomipramine.svg] || 303-49-1<br />
|-<br />
| [http://www.wikidata.org/entity/Q68484 Q68484] || prucalopride || C₁₈H₂₆ClN₃O₃ || [http://commons.wikimedia.org/wiki/Special:FilePath/Prucalopride.svg Prucalopride.svg] || 179474-81-8<br />
|-<br />
| [http://www.wikidata.org/entity/Q68566 Q68566] || mosapride || C₂₁H₂₅ClFN₃O₃ || [http://commons.wikimedia.org/wiki/Special:FilePath/Mosapride.svg Mosapride.svg] || 112885-41-3<br />
|-<br />
| [http://www.wikidata.org/entity/Q80232 Q80232] || cyclobutane || C₄H₈ || [http://commons.wikimedia.org/wiki/Special:FilePath/Cyclobutane2.svg Cyclobutane2.svg] || 287-23-0<br />
|-<br />
| [http://www.wikidata.org/entity/Q80868 Q80868] || tolonium chloride || C₁₅H₁₆ClN₃S || [http://commons.wikimedia.org/wiki/Special:FilePath/Tolonium%20chloride.svg Tolonium%20chloride.svg] || 92-31-9<br />
|-<br />
| [http://www.wikidata.org/entity/Q83320 Q83320] || nitric acid || HNO₃ || [http://commons.wikimedia.org/wiki/Special:FilePath/Nitric-acid.png Nitric-acid.png] || 12507-77-6<br />
|-<br />
| [http://www.wikidata.org/entity/Q83320 Q83320] || nitric acid || HNO₃ || [http://commons.wikimedia.org/wiki/Special:FilePath/Nitric-acid.png Nitric-acid.png] || 7697-37-2<br />
|}<br />
== Manually improved result ==<br />
{| class="wikitable" style="text-align: left;"<br />
|+ <!-- caption --><br />
|-<br />
! substance !! substanceLabel !! formula !! structure !! CAS<br />
|-<br />
| [http://www.wikidata.org/entity/Q32703 Q32703] || aminomethylpropanol || C₄H₁₁NO || [[File:2-amino-2-methyl-1-propanol.svg|150px|2-amino-2-methyl-1-propanol.svg]] || 124-68-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q32703 Q32703] || aminomethylpropanol || C₄H₁₁NO || [[File:Isobutanolamine%20t.png|150px|Isobutanolamine t.png]] || 124-68-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q43656 Q43656] || cholesterol || C₂₇H₄₆O || [[File:Structural%20formula%20of%20cholesterol.svg|150px|Structural formula of cholesterol.svg]] || 57-88-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q45143 Q45143] || fulminic acid || CHNO || [[File:Fulminezuur.png|150px|Fulminezuur.png]] || 506-85-4<br />
|-<br />
| [http://www.wikidata.org/entity/Q49546 Q49546] || acetone || C₃H₆O || [[File:Acetone-2D-skeletal.svg|150px|Acetone-2D-skeletal.svg]] || 67-64-1<br />
|-<br />
| [http://www.wikidata.org/entity/Q49546 Q49546] || acetone || C₃H₆O || [[File:Acetone-structural.png|150px|Acetone-structural.png]] || 67-64-1<br />
|-<br />
| [http://www.wikidata.org/entity/Q52858 Q52858] || ethane || C₂H₆ || [[File:Ethan%20Keilstrich.svg|150px|Ethan Keilstrich.svg]] || 74-84-0<br />
|-<br />
| [http://www.wikidata.org/entity/Q58356 Q58356] || amoxapine || C₁₇H₁₆ClN₃O || [[File:Amoxapine.svg|150px|Amoxapine.svg]] || 14028-44-5<br />
|-<br />
| [http://www.wikidata.org/entity/Q58713 Q58713] || clomipramine || C₁₉H₂₃ClN₂ || [[File:Clomipramine.svg|150px|Clomipramine.svg]] || 303-49-1<br />
|-<br />
| [http://www.wikidata.org/entity/Q68484 Q68484] || prucalopride || C₁₈H₂₆ClN₃O₃ || [[File:Prucalopride.svg|150px|Prucalopride.svg]] || 179474-81-8<br />
|-<br />
| [http://www.wikidata.org/entity/Q68566 Q68566] || mosapride || C₂₁H₂₅ClFN₃O₃ || [[File:Mosapride.svg|150px|Mosapride.svg]] || 112885-41-3<br />
|-<br />
| [http://www.wikidata.org/entity/Q80232 Q80232] || cyclobutane || C₄H₈ || [[File:Cyclobutane2.svg|150px|Cyclobutane2.svg]] || 287-23-0<br />
|-<br />
| [http://www.wikidata.org/entity/Q80868 Q80868] || tolonium chloride || C₁₅H₁₆ClN₃S || [[File:Tolonium%20chloride.svg|150px|Tolonium chloride.svg]] || 92-31-9<br />
|-<br />
| [http://www.wikidata.org/entity/Q83320 Q83320] || nitric acid || HNO₃ || [[File:Nitric-acid.png|150px|Nitric-acid.png]] || 12507-77-6<br />
|-<br />
| [http://www.wikidata.org/entity/Q83320 Q83320] || nitric acid || HNO₃ || [[File:Nitric-acid.png|150px|Nitric-acid.png]] || 7697-37-2<br />
|}<br />
<br />
=== Ten largest cities of the world ===<br />
Wikidata SPARQL query showing the 10 most populated cities of the world using the million city class Q1637706 for selection<br />
==== query ====<br />
<source lang='sparql'><br />
# Ten Largest cities of the world <br />
# WF 2021-08-23<br />
# see also http://wiki.bitplan.com/index.php/PyLoDStorage#Examples<br />
SELECT DISTINCT ?city ?cityLabel ?population ?country ?countryLabel <br />
WHERE {<br />
VALUES ?cityClass { wd:Q1637706}.<br />
?city wdt:P31 ?cityClass .<br />
?city wdt:P1082 ?population .<br />
?city wdt:P17 ?country .<br />
SERVICE wikibase:label {<br />
bd:serviceParam wikibase:language "en" .<br />
}<br />
}<br />
ORDER BY DESC(?population)<br />
LIMIT 10<br />
</source><br />
<br />
[https://query.wikidata.org/#%23%20Ten%20Largest%20cities%20of%20the%20world%20%0A%23%20WF%202021-08-23%0A%23%20see%20also%20http%3A//wiki.bitplan.com/index.php/PyLoDStorage%23Examples%0ASELECT%20DISTINCT%20%3Fcity%20%3FcityLabel%20%3Fpopulation%20%3Fcountry%20%3FcountryLabel%20%0AWHERE%20%7B%0A%20%20VALUES%20%3FcityClass%20%7B%20wd%3AQ1637706%7D.%0A%20%20%3Fcity%20wdt%3AP31%20%3FcityClass%20.%0A%20%20%3Fcity%20wdt%3AP1082%20%3Fpopulation%20.%0A%20%20%3Fcity%20wdt%3AP17%20%3Fcountry%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%0A%20%20%7D%0A%7D%0AORDER%20BY%20DESC%28%3Fpopulation%29%0ALIMIT%2010 try it!]<br />
==== result ====<br />
{| class="wikitable" style="text-align: left;"<br />
|+ <!-- caption --><br />
|-<br />
! city !! cityLabel !! align="right"| population !! country !! countryLabel<br />
|-<br />
| [http://www.wikidata.org/entity/Q1353 Q1353] || Delhi || align="right"| 26495000 || [http://www.wikidata.org/entity/Q668 Q668] || India<br />
|-<br />
| [http://www.wikidata.org/entity/Q8686 Q8686] || Shanghai || align="right"| 23390000 || [http://www.wikidata.org/entity/Q148 Q148] || People's Republic of China<br />
|-<br />
| [http://www.wikidata.org/entity/Q956 Q956] || Beijing || align="right"| 21710000 || [http://www.wikidata.org/entity/Q148 Q148] || People's Republic of China<br />
|-<br />
| [http://www.wikidata.org/entity/Q1354 Q1354] || Dhaka || align="right"| 16800000 || [http://www.wikidata.org/entity/Q902 Q902] || Bangladesh<br />
|-<br />
| [http://www.wikidata.org/entity/Q1156 Q1156] || Mumbai || align="right"| 15414288 || [http://www.wikidata.org/entity/Q668 Q668] || India<br />
|-<br />
| [http://www.wikidata.org/entity/Q8660 Q8660] || Karachi || align="right"| 14910352 || [http://www.wikidata.org/entity/Q843 Q843] || Pakistan<br />
|-<br />
| [http://www.wikidata.org/entity/Q8673 Q8673] || Lagos || align="right"| 14862000 || [http://www.wikidata.org/entity/Q1033 Q1033] || Nigeria<br />
|-<br />
| [http://www.wikidata.org/entity/Q406 Q406] || Istanbul || align="right"| 14657434 || [http://www.wikidata.org/entity/Q43 Q43] || Turkey<br />
|-<br />
| [http://www.wikidata.org/entity/Q1490 Q1490] || Tokyo || align="right"| 13942024 || [http://www.wikidata.org/entity/Q17 Q17] || Japan<br />
|-<br />
| [http://www.wikidata.org/entity/Q11736 Q11736] || Tianjin || align="right"| 13245000 || [http://www.wikidata.org/entity/Q148 Q148] || People's Republic of China<br />
|}<br />
<br />
=== count OpenStreetMap place type instances ===<br />
This SPARQL query <br />
determines the number of instances available in the OpenStreetMap for the placeTypes city,town and village<br />
<br />
==== query ====<br />
<source lang='sparql'><br />
# count osm place type instances<br />
# WF 2021-08-23<br />
SELECT (count(?instance) as ?count) ?placeType ?placeTypeLabel<br />
WHERE { <br />
VALUES ?placeType {<br />
"city"<br />
"town"<br />
"village"<br />
}<br />
?instance osmt:place ?placeType<br />
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }<br />
}<br />
GROUP BY ?placeType ?placeTypeLabel<br />
ORDER BY ?count<br />
</source><br />
<br />
[https://sophox.org/#%20count%20osm%20place%20type%20instances%0A#%20WF%202021-08-23%0ASELECT%20%28count%28%3Finstance%29%20as%20%3Fcount%29%20%3FplaceType%20%3FplaceTypeLabel%0AWHERE%20%7B%20%0A%20%20VALUES%20%3FplaceType%20%7B%0A%20%20%20%20%22city%22%0A%20%20%20%20%22town%22%0A%20%20%20%20%22village%22%0A%20%20%7D%0A%20%20%3Finstance%20osmt%3Aplace%20%3FplaceType%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D%0AGROUP%20BY%20%3FplaceType%20%3FplaceTypeLabel%0AORDER%20BY%20%3Fcount try it!]<br />
<br />
==== result ====<br />
{| class="wikitable" style="text-align: left;"<br />
|+ <!-- caption --><br />
|-<br />
! align="right"| count !! placeType !! placeTypeLabel<br />
|-<br />
| align="right"| 13614 || city || city<br />
|-<br />
| align="right"| 23238 || town || town<br />
|-<br />
| align="right"| 153380 || village || village<br />
|}<br />
<br />
= Apache Jena =<br />
The jena -l and jena -f options will automatically download and unpack the needed Apache jena files.<br />
== Jena load example dataset ==<br />
<source lang='bash'><br />
scripts/jena -l sampledata/example.ttl<br />
</source><br />
== Jena fuseki server start ==<br />
<source lang='bash'><br />
scripts/jena -f example<br />
</source><br />
You should be able to browse the admin GUI at http://localhost:3030 and have the example dataset ready for you<br />
== Jena fuseki server stop ==<br />
<source lang='bash'><br />
scripts/jena -k<br />
</source><br />
<br />
== jena script usage ==<br />
<source lang='bash'><br />
scripts/jena -h<br />
scripts/jena [-f|--fuseki|-h|--help|-k|--kill|-l|--load]<br />
<br />
-f | --fuseki [dataset]: download and start fuseki server with the given dataset<br />
-h | --help: show this usage<br />
-k | --kill: kill the running fuseki server<br />
-l | --load [ttl file]: download jena / tdbloader and load given ttl file<br />
</source><br />
<br />
= Example Unit tests =<br />
== JSON unit test ==<br />
<source lang='python'><br />
'''<br />
Created on 2020-09-12<br />
<br />
@author: wf<br />
'''<br />
import unittest<br />
import json<br />
from lodstorage.sample import Royals,Cities<br />
from lodstorage.jsonable import JSONAble<br />
from lodstorage.types import Types<br />
import time<br />
<br />
class TestJsonAble(unittest.TestCase):<br />
'''<br />
test JSON serialization with JsonAble mixin<br />
'''<br />
<br />
def setUp(self):<br />
self.profile=True<br />
self.debug=True<br />
pass<br />
<br />
def tearDown(self):<br />
pass<br />
<br />
def testSingleToDoubleQuote(self):<br />
jsonStr='''<br />
{<br />
"cities": [<br />
{<br />
"name": "Upper Hell's Gate"<br />
},<br />
{<br />
"name": "N'zeto"<br />
}<br />
]<br />
}<br />
'''<br />
listOfDicts=json.loads(jsonStr)<br />
dictStr=str(listOfDicts) <br />
if self.debug:<br />
print(dictStr)<br />
jsonStr2=JSONAble.singleQuoteToDoubleQuote(dictStr)<br />
if self.debug:<br />
print(jsonStr2)<br />
self.assertEqual('''{"cities": [{"name": "Upper Hell's Gate"}, {"name": "N'zeto"}]}''',jsonStr2)<br />
<br />
def testSingleQuoteToDoubleQuoteStackoverflow(self):<br />
"""<br />
see <br />
- https://stackoverflow.com/a/63862387/1497139 <br />
- https://stackoverflow.com/a/50257217/1497139<br />
"""<br />
singleQuotedExamples=[<br />
'''{'cities': [{'name': "Upper Hell's Gate"}, {'name': "N'zeto"}]''']<br />
for example in singleQuotedExamples:<br />
print (example)<br />
for useRegex in [False,True]:<br />
doubleQuoted=JSONAble.singleQuoteToDoubleQuote(example,useRegex=useRegex)<br />
print(doubleQuoted)<br />
print<br />
<br />
def dumpListOfDicts(self,listOfDicts,limit):<br />
if self.debug:<br />
for index,record in enumerate(listOfDicts[:limit]):<br />
print("%2d:%s" % (index,record))<br />
<br />
def check(self,manager,manager1,listName,debugLimit):<br />
self.dumpListOfDicts(manager.__dict__[listName], debugLimit)<br />
self.dumpListOfDicts(manager1.__dict__[listName], debugLimit)<br />
#self.assertEqual(manager.__dict__,manager1.__dict__) <br />
<br />
def testJsonAble(self):<br />
'''<br />
test JSONAble<br />
'''<br />
examples=[{<br />
'manager': Royals(),<br />
'listName': 'royals'<br />
}, {<br />
'manager': Cities(),<br />
'listName': 'cities'<br />
}<br />
]<br />
debugLimit=10<br />
debugChars=debugLimit*100<br />
index=0<br />
for useToJson in [True,False]:<br />
for example in examples:<br />
starttime=time.time()<br />
manager=example['manager']<br />
listName=example['listName']<br />
if useToJson:<br />
jsonStr=manager.toJSON()<br />
else:<br />
jsonStr=manager.asJSON()<br />
if self.debug:<br />
print(jsonStr[:debugChars])<br />
#print(jsonStr,file=open('/tmp/example%d.json' %index,'w'))<br />
index+=1<br />
if self.profile:<br />
print("->JSON for %d took %7.3f s" % (index, (time.time()-starttime)))<br />
self.assertTrue(isinstance(jsonStr,str))<br />
starttime=time.time()<br />
jsonDict=json.loads(jsonStr)<br />
self.assertTrue(isinstance(jsonDict,dict))<br />
if self.debug:<br />
print(str(jsonDict)[:debugChars])<br />
if self.profile:<br />
print("<-JSON for %d took %7.3f s" % (index, time.time()-starttime))<br />
cls=manager.__class__<br />
types=Types(cls.__name__)<br />
types.getTypes(listName,manager.__dict__[listName])<br />
manager1=cls()<br />
manager1.fromJson(jsonStr,types=types)<br />
self.check(manager,manager1,listName,debugLimit=debugLimit)<br />
pass<br />
<br />
<br />
if __name__ == "__main__":<br />
#import sys;sys.argv = ['', 'Test.testName']<br />
unittest.main()<br />
</source><br />
== SQLDB unit test ==<br />
<source lang='python'><br />
'''<br />
Created on 2020-08-24<br />
<br />
@author: wf<br />
'''<br />
import unittest<br />
from datetime import datetime<br />
import time<br />
import os<br />
import sys<br />
from lodstorage.sample import Sample<br />
from lodstorage.uml import UML<br />
from lodstorage.sql import SQLDB, EntityInfo<br />
<br />
<br />
class TestSQLDB(unittest.TestCase):<br />
'''<br />
Test the SQLDB database wrapper<br />
'''<br />
<br />
def setUp(self):<br />
self.debug=True<br />
pass<br />
<br />
def tearDown(self):<br />
pass<br />
<br />
def checkListOfRecords(self,listOfRecords,entityName,primaryKey=None,executeMany=True,fixDates=False,debug=False,doClose=True):<br />
'''<br />
check the handling of the given list of Records<br />
<br />
Args:<br />
<br />
listOfRecords(list): a list of dicts that contain the data to be stored<br />
entityName(string): the name of the entity type to be used as a table name<br />
primaryKey(string): the name of the key / column to be used as a primary key<br />
executeMany(boolean): True if executeMany mode of sqlite3 should be used<br />
debug(boolean): True if debug information e.g. CREATE TABLE and INSERT INTO commands should be shown<br />
doClose(boolean): True if the connection should be closed<br />
<br />
''' <br />
size=len(listOfRecords)<br />
print("%s size is %d fixDates is: %r" % (entityName,size,fixDates))<br />
self.sqlDB=SQLDB(debug=debug,errorDebug=True)<br />
entityInfo=self.sqlDB.createTable(listOfRecords[:10],entityName,primaryKey)<br />
startTime=time.time()<br />
self.sqlDB.store(listOfRecords,entityInfo,executeMany=executeMany)<br />
elapsed=time.time()-startTime<br />
print ("adding %d %s records took %5.3f s => %5.f records/s" % (size,entityName,elapsed,size/elapsed)) <br />
resultList=self.sqlDB.queryAll(entityInfo,fixDates=fixDates) <br />
print ("selecting %d %s records took %5.3f s => %5.f records/s" % (len(resultList),entityName,elapsed,len(resultList)/elapsed)) <br />
if doClose:<br />
self.sqlDB.close()<br />
return resultList<br />
<br />
def testEntityInfo(self):<br />
'''<br />
test creating entityInfo from the sample record<br />
'''<br />
listOfRecords=Sample.getRoyals()<br />
entityInfo=EntityInfo(listOfRecords[:3],'Person','name',debug=True)<br />
self.assertEqual("CREATE TABLE Person(name TEXT PRIMARY KEY,born DATE,numberInLine INTEGER,wikidataurl TEXT,age FLOAT,ofAge BOOLEAN,lastmodified TIMESTAMP)",entityInfo.createTableCmd)<br />
self.assertEqual("INSERT INTO Person (name,born,numberInLine,wikidataurl,age,ofAge,lastmodified) values (:name,:born,:numberInLine,:wikidataurl,:age,:ofAge,:lastmodified)",entityInfo.insertCmd)<br />
self.sqlDB=SQLDB(debug=self.debug,errorDebug=True)<br />
entityInfo=self.sqlDB.createTable(listOfRecords[:10],entityInfo.name,entityInfo.primaryKey)<br />
tableList=self.sqlDB.getTableList()<br />
if self.debug:<br />
print (tableList)<br />
self.assertEqual(1,len(tableList))<br />
personTable=tableList[0]<br />
self.assertEqual("Person",personTable['name'])<br />
self.assertEqual(7,len(personTable['columns']))<br />
uml=UML()<br />
plantUml=uml.tableListToPlantUml(tableList,packageName="Royals",withSkin=False)<br />
if self.debug:<br />
print(plantUml)<br />
expected="""package Royals {<br />
class Person << Entity >> {<br />
age : FLOAT <br />
born : DATE <br />
lastmodified : TIMESTAMP <br />
name : TEXT <<PK>><br />
numberInLine : INTEGER <br />
ofAge : BOOLEAN <br />
wikidataurl : TEXT <br />
}<br />
}<br />
"""<br />
self.assertEqual(expected,plantUml)<br />
<br />
# testGeneralization<br />
listOfRecords=[{'name': 'Royal family', 'country': 'UK', 'lastmodified':datetime.now()}]<br />
entityInfo=self.sqlDB.createTable(listOfRecords[:10],'Family','name')<br />
tableList=self.sqlDB.getTableList()<br />
self.assertEqual(2,len(tableList))<br />
uml=UML()<br />
plantUml=uml.tableListToPlantUml(tableList,generalizeTo="PersonBase",withSkin=False)<br />
print(plantUml)<br />
expected='''class PersonBase << Entity >> {<br />
lastmodified : TIMESTAMP <br />
name : TEXT <<PK>><br />
}<br />
class Person << Entity >> {<br />
age : FLOAT <br />
born : DATE <br />
numberInLine : INTEGER <br />
ofAge : BOOLEAN <br />
wikidataurl : TEXT <br />
}<br />
class Family << Entity >> {<br />
country : TEXT <br />
}<br />
PersonBase <|-- Person<br />
PersonBase <|-- Family<br />
'''<br />
self.assertEqual(expected,plantUml)<br />
<br />
def testUniqueConstraint(self):<br />
'''<br />
test for https://github.com/WolfgangFahl/pyLoDStorage/issues/4<br />
sqlite3.IntegrityError: UNIQUE constraint failed: ... show debug info<br />
'''<br />
listOfDicts=[<br />
{"name": "John Doe"},<br />
{"name": "Frank Doe"}, <br />
{"name": "John Doe"}, <br />
{"name":"Tim Doe"}]<br />
sqlDB=SQLDB(debug=self.debug,errorDebug=True)<br />
entityInfo=sqlDB.createTable(listOfDicts[:10],'Does','name')<br />
try:<br />
sqlDB.store(listOfDicts,entityInfo,executeMany=False)<br />
self.fail("There should be an exception")<br />
except Exception as ex:<br />
expected="""INSERT INTO Does (name) values (:name)<br />
failed:UNIQUE constraint failed: Does.name<br />
record #3={'name': 'John Doe'}"""<br />
errMsg=str(ex)<br />
self.assertEqual(expected,errMsg)<br />
<br />
def testSqlite3(self):<br />
'''<br />
test sqlite3 with a few records from the royal family<br />
'''<br />
listOfRecords=Sample.getRoyals()<br />
resultList=self.checkListOfRecords(listOfRecords, 'Person', 'name',debug=True)<br />
if self.debug:<br />
print(resultList)<br />
self.assertEqual(listOfRecords,resultList)<br />
<br />
def testBindingError(self):<br />
'''<br />
test list of Records with incomplete record leading to<br />
"You did not supply a value for binding 2"<br />
see https://bugs.python.org/issue41638<br />
'''<br />
listOfRecords=[{'name':'Pikachu', 'type':'Electric'},{'name':'Raichu' }]<br />
for executeMany in [True,False]:<br />
try:<br />
self.checkListOfRecords(listOfRecords,'Pokemon','name',executeMany=executeMany)<br />
self.fail("There should be an exception")<br />
except Exception as ex:<br />
if self.debug:<br />
print(str(ex))<br />
self.assertTrue('no value supplied for column' in str(ex)) <br />
<br />
def testListOfCities(self):<br />
'''<br />
test sqlite3 with some 120000 city records<br />
'''<br />
listOfRecords=Sample.getCities()<br />
for fixDates in [True,False]:<br />
retrievedList=self.checkListOfRecords(listOfRecords,'City',fixDates=fixDates)<br />
self.assertEqual(len(listOfRecords),len(retrievedList))<br />
<br />
def testQueryParams(self):<br />
'''<br />
test Query Params<br />
'''<br />
listOfDicts=[<br />
{"city": "New York", "country": "US"},<br />
{"city": "Amsterdam", "country": "NL"},<br />
{"city": "Paris", "country": "FR"}]<br />
sqlDB=SQLDB(debug=self.debug,errorDebug=True)<br />
entityInfo=sqlDB.createTable(listOfDicts[:10],'cities','city')<br />
sqlDB.store(listOfDicts,entityInfo,executeMany=False)<br />
query="SELECT * from cities WHERE country in (?)"<br />
params=('FR',)<br />
frCities=sqlDB.query(query,params)<br />
if self.debug:<br />
print (frCities);<br />
self.assertEqual([{'city': 'Paris', 'country': 'FR'}],frCities)<br />
<br />
def testSqllite3Speed(self):<br />
'''<br />
test sqlite3 speed with some 100000 artificial sample records<br />
consisting of two columns with a running index<br />
'''<br />
limit=100000<br />
listOfRecords=Sample.getSample(limit)<br />
self.checkListOfRecords(listOfRecords, 'Sample', 'pKey') <br />
<br />
def testBackup(self):<br />
'''<br />
test creating a backup of the SQL database<br />
'''<br />
if sys.version_info >= (3, 7):<br />
listOfRecords=Sample.getCities()<br />
self.checkListOfRecords(listOfRecords,'City',fixDates=True,doClose=False)<br />
backupDB="/tmp/testSqlite.db"<br />
self.sqlDB.backup(backupDB,profile=True,showProgress=200)<br />
size=os.stat(backupDB).st_size<br />
print ("size of backup DB is %d" % size)<br />
self.assertTrue(size>600000)<br />
self.sqlDB.close()<br />
# restore<br />
ramDB=SQLDB.restore(backupDB, SQLDB.RAM, profile=True)<br />
entityInfo=EntityInfo(listOfRecords[:50],'City',debug=True)<br />
allCities=ramDB.queryAll(entityInfo)<br />
self.assertEqual(len(allCities),len(listOfRecords))<br />
<br />
def testCopy(self):<br />
'''<br />
test copying databases into another database<br />
'''<br />
dbFile="/tmp/DAWT_Sample3x1000.db"<br />
copyDB=SQLDB(dbFile)<br />
for sampleNo in range(3):<br />
listOfRecords=Sample.getSample(1000)<br />
self.checkListOfRecords(listOfRecords, 'Sample_%d_1000' %sampleNo, 'pKey',doClose=False) <br />
self.sqlDB.copyTo(copyDB)<br />
size=os.stat(dbFile).st_size<br />
print ("size of copy DB is %d" % size)<br />
self.assertTrue(size>70000)<br />
tableList=copyDB.getTableList()<br />
print(tableList)<br />
for sampleNo in range(3):<br />
self.assertEqual('Sample_%d_1000' %sampleNo,tableList[sampleNo]['name'])<br />
<br />
<br />
if __name__ == "__main__":<br />
#import sys;sys.argv = ['', 'Test.testSqllit3']<br />
unittest.main()<br />
</source><br />
== SPARQL unit test ==<br />
see https://github.com/WolfgangFahl/pyLoDStorage/blob/master/tests/testSPARQL.py<br />
<source lang='python'><br />
'''<br />
Created on 2020-08-14<br />
<br />
@author: wf<br />
'''<br />
import unittest<br />
import getpass<br />
from lodstorage.sparql import SPARQL<br />
from lodstorage.sample import Sample<br />
import time<br />
<br />
class TestSPARQL(unittest.TestCase):<br />
''' Test SPARQL access e.g. Apache Jena via Wrapper'''<br />
<br />
def setUp(self):<br />
self.debug=False<br />
pass<br />
<br />
<br />
def tearDown(self):<br />
pass<br />
<br />
def getJena(self,mode='query',debug=False,typedLiterals=False,profile=False):<br />
'''<br />
get the jena endpoint for the given mode<br />
<br />
Args:<br />
mode(string): query or update<br />
debug(boolean): True if debug information should be output<br />
typedLiterals(boolean): True if INSERT DATA SPARQL commands should use typed literals<br />
profile(boolean): True if profile/timing information should be shown<br />
'''<br />
endpoint="http://localhost:3030/example"<br />
jena=SPARQL(endpoint,mode=mode,debug=debug,typedLiterals=typedLiterals,profile=profile)<br />
return jena<br />
<br />
def testJenaQuery(self):<br />
'''<br />
test Apache Jena Fuseki SPARQL endpoint with example SELECT query <br />
'''<br />
jena=self.getJena()<br />
queryString = "SELECT * WHERE { ?s ?p ?o. }"<br />
results=jena.query(queryString)<br />
self.assertTrue(len(results)>20)<br />
pass<br />
<br />
def testJenaInsert(self):<br />
'''<br />
test a Jena INSERT DATA<br />
'''<br />
jena=self.getJena(mode="update")<br />
insertCommands = [ """<br />
PREFIX cr: <http://cr.bitplan.com/><br />
INSERT DATA { <br />
cr:version cr:author "Wolfgang Fahl". <br />
}<br />
""",'INVALID COMMAND']<br />
for index,insertCommand in enumerate(insertCommands):<br />
result,ex=jena.insert(insertCommand)<br />
if index==0:<br />
self.assertTrue(ex is None)<br />
print(result)<br />
else:<br />
msg=ex.args[0]<br />
self.assertTrue("QueryBadFormed" in msg)<br />
self.assertTrue("Error 400" in msg)<br />
pass<br />
<br />
def checkErrors(self,errors,expected=0): <br />
'''<br />
check the given list of errors - print any errors if there are some<br />
and after that assert that the length of the list of errors is zero<br />
<br />
Args:<br />
errors(list): the list of errors to check<br />
'''<br />
if len(errors)>0:<br />
print("ERRORS:")<br />
for error in errors:<br />
print(error)<br />
self.assertEquals(expected,len(errors)) <br />
<br />
def testDob(self):<br />
'''<br />
test the DOB (date of birth) function that converts from ISO-Date to<br />
datetime.date<br />
'''<br />
dt=Sample.dob("1926-04-21")<br />
self.assertEqual(1926,dt.year)<br />
self.assertEqual(4,dt.month)<br />
self.assertEqual(21,dt.day)<br />
<br />
def testListOfDictInsert(self):<br />
'''<br />
test inserting a list of Dicts and retrieving the values again<br />
using a person based example<br />
instead of<br />
https://en.wikipedia.org/wiki/FOAF_(ontology)<br />
<br />
we use an object oriented derivate of FOAF with a focus on datatypes<br />
'''<br />
listofDicts=Sample.getRoyals()<br />
typedLiteralModes=[True,False]<br />
entityType='foafo:Person'<br />
primaryKey='name'<br />
prefixes='PREFIX foafo: <http://foafo.bitplan.com/foafo/0.1/>'<br />
for typedLiteralMode in typedLiteralModes:<br />
jena=self.getJena(mode='update',typedLiterals=typedLiteralMode,debug=True)<br />
deleteString= """<br />
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#><br />
PREFIX foafo: <http://foafo.bitplan.com/foafo/0.1/><br />
DELETE WHERE { <br />
?person a 'foafo:Person'.<br />
?person ?p ?o. <br />
}<br />
"""<br />
jena.query(deleteString)<br />
errors=jena.insertListOfDicts(listofDicts,entityType,primaryKey,prefixes)<br />
self.checkErrors(errors)<br />
<br />
jena=self.getJena(mode="query",debug=True)<br />
queryString = """<br />
PREFIX foafo: <http://foafo.bitplan.com/foafo/0.1/><br />
SELECT ?name ?born ?numberInLine ?wikidataurl ?age ?ofAge ?lastmodified WHERE { <br />
?person a 'foafo:Person'.<br />
?person foafo:Person_name ?name.<br />
?person foafo:Person_born ?born.<br />
?person foafo:Person_numberInLine ?numberInLine.<br />
?person foafo:Person_wikidataurl ?wikidataurl.<br />
?person foafo:Person_age ?age.<br />
?person foafo:Person_ofAge ?ofAge.<br />
?person foafo:Person_lastmodified ?lastmodified. <br />
}"""<br />
personResults=jena.query(queryString)<br />
self.assertEqual(len(listofDicts),len(personResults))<br />
personList=jena.asListOfDicts(personResults) <br />
for index,person in enumerate(personList):<br />
print("%d: %s" %(index,person))<br />
# check the correct round-trip behavior<br />
self.assertEqual(listofDicts,personList)<br />
<br />
def testControlEscape(self):<br />
'''<br />
check the control-escaped version of an UTF-8 string<br />
'''<br />
controls="Α\tΩ\r\n";<br />
expected="Α\\tΩ\\r\\n"<br />
esc=SPARQL.controlEscape(controls)<br />
self.assertEqual(expected,esc) <br />
<br />
def testSPARQLErrorMessage(self):<br />
'''<br />
test error handling <br />
see https://stackoverflow.com/questions/63486767/how-can-i-get-the-fuseki-api-via-sparqlwrapper-to-properly-report-a-detailed-err<br />
'''<br />
listOfDicts=[{<br />
'title': '“Bioinformatics of Genome Regulation and Structure\Systems Biology” – BGRS\SB-2018',<br />
'url': 'https://thenode.biologists.com/event/11th-international-multiconference-bioinformatics-genome-regulation-structuresystems-biology-bgrssb-2018/'}]<br />
entityType="cr:Event" <br />
primaryKey='title'<br />
prefixes="PREFIX cr: <http://cr.bitplan.com/Event/0.1/>"<br />
jena=self.getJena(mode='update',typedLiterals=False,debug=True)<br />
errors=jena.insertListOfDicts(listOfDicts,entityType,primaryKey,prefixes)<br />
self.checkErrors(errors,1)<br />
error=errors[0]<br />
self.assertTrue("probably the sparql query is bad formed" in error)<br />
<br />
<br />
def testEscapeStringContent(self):<br />
'''<br />
test handling of double quoted strings<br />
'''<br />
helpListOfDicts=[{'topic':'edit','description': '''Use <br />
the "edit" <br />
button to start editing - you can use <br />
- tab \t <br />
- carriage return \r <br />
- newline \n<br />
<br />
as escape characters <br />
'''<br />
}]<br />
entityType='help:Topic'<br />
primaryKey='topic'<br />
prefixes='PREFIX help: <http://help.bitplan.com/help/0.0.1/>' <br />
jena=self.getJena(mode='update',debug=True)<br />
errors=jena.insertListOfDicts(helpListOfDicts, entityType, primaryKey, prefixes, profile=True)<br />
self.checkErrors(errors)<br />
query="""<br />
PREFIX help: <http://help.bitplan.com/help/0.0.1/><br />
SELECT ?topic ?description<br />
WHERE {<br />
?help help:Topic_topic ?topic.<br />
?help help:Topic_description ?description.<br />
}<br />
""" <br />
jena=self.getJena(mode='query')<br />
listOfDicts=jena.queryAsListOfDicts(query)<br />
# check round trip equality<br />
self.assertEqual(helpListOfDicts,listOfDicts)<br />
<br />
def testIssue7(self):<br />
'''<br />
test conversion of dates with timezone info<br />
'''<br />
value="2020-01-01T00:00:00Z"<br />
dt=SPARQL.strToDatetime(value)<br />
self.assertEqual(dt.year,2020)<br />
<br />
def testListOfDictSpeed(self):<br />
'''<br />
test the speed of adding data<br />
''' <br />
limit=5000<br />
for batchSize in [None,1000]:<br />
listOfDicts=Sample.getSample(limit)<br />
jena=self.getJena(mode='update',profile=True)<br />
entityType="ex:TestRecord"<br />
primaryKey='pkey'<br />
prefixes='PREFIX ex: <http://example.com/>'<br />
startTime=time.time()<br />
errors=jena.insertListOfDicts(listOfDicts, entityType, primaryKey, prefixes,batchSize=batchSize) <br />
self.checkErrors(errors)<br />
elapsed=time.time()-startTime<br />
print ("adding %d records took %5.3f s => %5.f records/s" % (limit,elapsed,limit/elapsed))<br />
<br />
def testLocalWikdata(self):<br />
'''<br />
check local wikidata<br />
'''<br />
# check we have local wikidata copy:<br />
if getpass.getuser()=="wf":<br />
# use 2018 wikidata copy<br />
endpoint="http://jena.zeus.bitplan.com/wikidata/"<br />
wd=SPARQL(endpoint)<br />
queryString="""# get a list of whisky distilleries<br />
PREFIX wd: <http://www.wikidata.org/entity/> <br />
PREFIX wdt: <http://www.wikidata.org/prop/direct/><br />
SELECT ?item ?coord <br />
WHERE <br />
{<br />
# instance of whisky distillery<br />
?item wdt:P31 wd:Q10373548.<br />
# get the coordinate<br />
?item wdt:P625 ?coord.<br />
}<br />
"""<br />
results=wd.query(queryString)<br />
self.assertTrue(238<=len(results))<br />
<br />
<br />
if __name__ == "__main__":<br />
#import sys;sys.argv = ['', 'Test.testName']<br />
unittest.main()<br />
<br />
</source><br />
= Tickets =<br />
{{:PyLoDStorage/Tickets}}</div>
Wf
https://wiki.bitplan.com/index.php?title=Dcm&diff=18428
Dcm
2024-03-02T12:04:53Z
<p>Wf: /* DCM Online Service */</p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=dcm<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=dynamic competence map<br />
|url=https://github.com/WolfgangFahl/dcm/<br />
|version=0.0.2<br />
|description=dynamic competence map<br />
|date=2023-11-08<br />
|since=2023-11-06<br />
}}<br />
<br />
= Motivation =<br />
{{Link|target=Skills Wheel}}<br />
= Demo =<br />
* https://dcm.wikidata.dbis.rwth-aachen.de/<br />
* http://dcm.bitplan.com<br />
<br />
{{pip|dynamic-competence-map}}<br />
== Usage ==<br />
<source lang='bash' highlight='1'><br />
dcm -h<br />
usage: dcm [-h] [-a] [-c] [-d] [--debugServer DEBUGSERVER] [--debugPort DEBUGPORT]<br />
[--debugRemotePath DEBUGREMOTEPATH] [--debugLocalPath DEBUGLOCALPATH]<br />
[-l] [-i INPUT] [-rol] [--host HOST] [--port PORT] [-s] [-V] [-v]<br />
[-rp ROOT_PATH]<br />
<br />
python based visualization of dynamic competence maps<br />
<br />
options:<br />
-h, --help show this help message and exit<br />
-a, --about show about info [default: False]<br />
-c, --client start client [default: False]<br />
-d, --debug show debug info [default: False]<br />
--debugServer DEBUGSERVER<br />
remote debug Server<br />
--debugPort DEBUGPORT<br />
remote debug Port<br />
--debugRemotePath DEBUGREMOTEPATH<br />
remote debug Server path mapping - remotePath - path on<br />
debug server<br />
--debugLocalPath DEBUGLOCALPATH<br />
remote debug Server path mapping - localPath - path on<br />
machine where python runs<br />
-l, --local run with local file system access [default: False]<br />
-i INPUT, --input INPUT<br />
input file<br />
-rol, --render_on_load<br />
render on load [default: False]<br />
--host HOST the host to serve / listen from [default: localhost]<br />
--port PORT the port to serve from [default: 8885]<br />
-s, --serve start webserver [default: False]<br />
-V, --version show program's version number and exit<br />
-v, --verbose show verbose output [default: False]<br />
-rp ROOT_PATH, --root_path ROOT_PATH<br />
path to example json files [default: /Users/wf/Documents/p<br />
yworkspace/dcm/.venv/lib/python3.10/site-<br />
packages/dcm_examples]<br />
</source><br />
= DCM Online Service =<br />
{{#mermaid:flowchart LR<br />
YAML[YAML Input: Lehrplan] --> DCM{DCM Online Service}<br />
JSON[JSON Input: Kompetenzen] --> DCM<br />
DCM --> SVG[SVG Output]<br />
SVG -.-> Popups[Optional JavaScript Popups]<br />
<br />
YAML -->LP[CompetenceTree,\n CompetenceAspect,\n CompetenceArea,\n CompetenceFacet]<br />
JSON -->K[Learner,\n Achievement,\n CompetenceElement]<br />
<br />
<br />
LP -. generalizes .-> CompetenceElement<br />
K -. uses .-> CompetenceElement<br />
<br />
classDef input fill:#e6e6e6,stroke:#333,stroke-width:2px;<br />
classDef process fill:#bde0f0,stroke:#333,stroke-width:4px;<br />
classDef output fill:#e6e6e6,stroke:#333,stroke-width:2px;<br />
classDef optional fill:#F0EAD6,stroke:#333,stroke-width:2px;<br />
<br />
class YAML,JSON input;<br />
class DCM process;<br />
class SVG output;<br />
class Popups optional;<br />
<br />
}}<br />
= Example SVG =<br />
https://wiki.bitplan.com/images/wiki/8/88/1116e424-b4f9-45a2-acc1-c5d54350daea_competence_map_json_empty.svg</div>
Wf
https://wiki.bitplan.com/index.php?title=Template:Pip&diff=18427
Template:Pip
2024-03-02T12:04:07Z
<p>Wf: </p>
<hr />
<div><noinclude><br />
This is a template to describe the installation procedure via pip for a python package<br />
= Usage =<br />
== Example ==<br />
<pre>{{pip|pyLodStorage}}</pre><br />
{{pip|pyLodStorage}}<br />
[[Category:Template]]<br />
</noinclude><br />
<includeonly>{{#vardefine:package|{{{1|pyLodStorage}}}}}<br />
= Installation =<br />
{{#tag:source|<br />
pip install {{#var:package}}<br />
# alternatively if your pip is not a python3 pip<br />
pip3 install {{#var:package}} <br />
# local install from source directory of {{#var:package}} <br />
pip install .<br />
|lang=bash<br />
}}<br />
=== upgrade ===<br />
{{#tag:source|<br />
pip install {{#var:package}} -U<br />
# alternatively if your pip is not a python3 pip<br />
pip3 install {{#var:package}} -U<br />
|lang=bash<br />
}}<br />
</includeonly></div>
Wf
https://wiki.bitplan.com/index.php?title=Dcm&diff=18426
Dcm
2024-03-02T12:03:21Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=dcm<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=dynamic competence map<br />
|url=https://github.com/WolfgangFahl/dcm/<br />
|version=0.0.2<br />
|description=dynamic competence map<br />
|date=2023-11-08<br />
|since=2023-11-06<br />
}}<br />
<br />
= Motivation =<br />
{{Link|target=Skills Wheel}}<br />
= Demo =<br />
* https://dcm.wikidata.dbis.rwth-aachen.de/<br />
* http://dcm.bitplan.com<br />
<br />
{{pip|dynamic-competence-map}}<br />
== Usage ==<br />
<source lang='bash' highlight='1'><br />
dcm -h<br />
usage: dcm [-h] [-a] [-c] [-d] [--debugServer DEBUGSERVER] [--debugPort DEBUGPORT]<br />
[--debugRemotePath DEBUGREMOTEPATH] [--debugLocalPath DEBUGLOCALPATH]<br />
[-l] [-i INPUT] [-rol] [--host HOST] [--port PORT] [-s] [-V] [-v]<br />
[-rp ROOT_PATH]<br />
<br />
python based visualization of dynamic competence maps<br />
<br />
options:<br />
-h, --help show this help message and exit<br />
-a, --about show about info [default: False]<br />
-c, --client start client [default: False]<br />
-d, --debug show debug info [default: False]<br />
--debugServer DEBUGSERVER<br />
remote debug Server<br />
--debugPort DEBUGPORT<br />
remote debug Port<br />
--debugRemotePath DEBUGREMOTEPATH<br />
remote debug Server path mapping - remotePath - path on<br />
debug server<br />
--debugLocalPath DEBUGLOCALPATH<br />
remote debug Server path mapping - localPath - path on<br />
machine where python runs<br />
-l, --local run with local file system access [default: False]<br />
-i INPUT, --input INPUT<br />
input file<br />
-rol, --render_on_load<br />
render on load [default: False]<br />
--host HOST the host to serve / listen from [default: localhost]<br />
--port PORT the port to serve from [default: 8885]<br />
-s, --serve start webserver [default: False]<br />
-V, --version show program's version number and exit<br />
-v, --verbose show verbose output [default: False]<br />
-rp ROOT_PATH, --root_path ROOT_PATH<br />
path to example json files [default: /Users/wf/Documents/p<br />
yworkspace/dcm/.venv/lib/python3.10/site-<br />
packages/dcm_examples]<br />
</source><br />
= DCM Online Service =<br />
{{#mermaid:flowchart LR<br />
YAML[YAML Input: Lehrplan] --> DCM{DCM Online Service}<br />
JSON[JSON Input: Kompetenzen] --> DCM<br />
DCM --> SVG[SVG Output]<br />
SVG -.-> Popups[Optional JavaScript Popups]<br />
<br />
YAML -->LP[CompetenceTree,\n CompetenceAspect,\n CompetenceArea,\n CompetenceFacet]<br />
JSON -->K[Learner,\n Achievement,\n CompetenceElement]<br />
<br />
<br />
LP -. generalizes .-> CompetenceElement<br />
K -. uses .-> CompetenceElement<br />
<br />
classDef input fill:#e6e6e6,stroke:#333,stroke-width:2px;<br />
classDef process fill:#bde0f0,stroke:#333,stroke-width:4px;<br />
classDef output fill:#e6e6e6,stroke:#333,stroke-width:2px;<br />
classDef optional fill:#F0EAD6,stroke:#333,stroke-width:2px;<br />
<br />
class YAML,JSON input;<br />
class DCM process;<br />
class SVG output;<br />
class Popups optional;<br />
<br />
}}</div>
Wf
https://wiki.bitplan.com/index.php?title=Template:Pip&diff=18425
Template:Pip
2024-03-02T12:02:59Z
<p>Wf: /* DCM Online Service */</p>
<hr />
<div><noinclude><br />
This is a template to describe the installation procedure via pip for a python package<br />
= Usage =<br />
== Example ==<br />
<pre>{{pip|pyLodStorage}}</pre><br />
{{pip|pyLodStorage}}<br />
[[Category:Template]]<br />
</noinclude><br />
<includeonly>{{#vardefine:package|{{{1|pyLodStorage}}}}}<br />
= Installation =<br />
{{#tag:source|<br />
pip install {{#var:package}}<br />
# alternatively if your pip is not a python3 pip<br />
pip3 install {{#var:package}} <br />
# local install from source directory of {{#var:package}} <br />
pip install .<br />
|lang=bash<br />
}}<br />
=== upgrade ===<br />
{{#tag:source|<br />
pip install {{#var:package}} -U<br />
# alternatively if your pip is not a python3 pip<br />
pip3 install {{#var:package}} -U<br />
|lang=bash<br />
}}<br />
</includeonly><br />
= Example SVG =<br />
https://wiki.bitplan.com/images/wiki/8/88/1116e424-b4f9-45a2-acc1-c5d54350daea_competence_map_json_empty.svg</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18424
Py ez wikidata
2024-03-02T12:02:39Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.1.1<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-02<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip|py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18423
Py ez wikidata
2024-03-02T12:02:17Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.1.1<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-02<br />
|since=2024-03-01<br />
}}<br />
<br />
{{pip| py-ez-wikidata}}</div>
Wf
https://wiki.bitplan.com/index.php?title=Py_ez_wikidata&diff=18422
Py ez wikidata
2024-03-02T12:00:28Z
<p>Wf: </p>
<hr />
<div>=OsProject=<br />
<br />
{{OsProject<br />
|id=py_ez_wikidata<br />
|state=active<br />
|owner=WolfgangFahl<br />
|title=py_ez_wikidata<br />
|url=https://github.com/WolfgangFahl/py_ez_wikidata<br />
|version=0.0.1<br />
|description=Mapping for Wikidata allows creation of wikidata entries from dicts<br />
|date=2024-03-01<br />
|since=2024-03-01<br />
}}<br />
=tickets=</div>
Wf
https://wiki.bitplan.com/index.php?title=Microsoft_does_not_listen&diff=18421
Microsoft does not listen
2024-03-02T11:29:57Z
<p>Wf: /* Automatically set pythonpath correctly for default project setups */</p>
<hr />
<div>Did you know that Microsoft does not listen?<br />
<br />
I'll gather a few examples of frustration arising from Microsoft not listening here.<br />
= Visual Studio Code: Automatically set pythonpath correctly for default project setups =<br />
1/4 million views so far approx 150 upvotes but no implementation in vscode so far:<br />
* https://stackoverflow.com/questions/53653083/how-to-correctly-set-pythonpath-for-visual-studio-code#<br />
The ticket:<br />
* https://github.com/microsoft/vscode-python/issues/22824<br />
was closed in 2024-02 without proper investigation of the needs of the customers<br />
<br />
= OS language, default language, current language, keyboard, country are ALL independent!! =<br />
Who would have believed this? Microsoft never knew since they bought Presenter from Forethought in 1987 to market it as PowerPoint. 33 years later the state of affairs is:<br />
* https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/17817385-changing-language-to-apply-to-all-slides (which will give you a 404 as of 2021-11-24)<br />
So https://web.archive.org/web/20201210133832/https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/17817385-changing-language-to-apply-to-all-slides is needed to see how many people complained about this ..<br />
<br />
= Bugreporting! What Bug reporting? =<br />
So there is a bug in your software and the software detects it. See e.g. how Powerpoint 2016 might crash:<br />
[[File:Screenshot2020-11-20.png|400px]]<br />
<br />
You even get an apology that part of your work might have been lost due to the bug.<br />
<br />
What options to report the bug and get it fixed do you get?<br />
Of course none. Why should someone want this bug to be fixed. There is a repair option that might or might not work and no need to fix or listen. Your work might be lost but so what - you are using Microsoft software and loosing your work due to bugs in Microsoft software is going to be part of your daily routine soon. Get used to it and plan for it. I wonder what the valuation of Microsoft corp would be if the company would have to pay for all the lost work that is created with bugs like the one shown above. Could well be below zero ...<br />
= Command Language in Excel =<br />
* https://superuser.com/questions/984789/change-language-of-command-in-excel<br />
''This was very useful to me, +1! It is absurd that one should change the language of all the Office package only to have the Excel formulas in English, but it's Microsoft, no surprise!''<br />
<br />
= Links in PDF Export for notes pages =<br />
Used to work and is now broken.<br />
See: <br />
* https://answers.microsoft.com/en-us/msoffice/forum/all/exporting-powerpoint-notes-pages-to-pdf-breaks/86b46877-203e-4945-b130-e3c9279e529e<br />
for how Microsoft ignores the issue<br />
The link to the uservoice mentioned in the above blog entry:<br />
* https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/42208063-please-restore-capability-to-export-save-as-pdf-no<br />
is broken.<br />
= Powerpoint number of slides =<br />
Again 33 years later no need to count automatically - let the users have some fun doing this any time they add or remove a slide:<br />
''PowerPoint can automatically add numbers to your slides, but it can't automatically show a count (such as "slide 2 of 12"). You have to do that manually. ''<br />
* https://support.microsoft.com/en-us/office/show-the-slide-number-and-total-number-of-slides-on-every-slide-e62b363a-a5c4-413e-b7b7-52c1a4d9dd02</div>
Wf
https://wiki.bitplan.com/index.php?title=Microsoft_does_not_listen&diff=18420
Microsoft does not listen
2024-03-02T11:27:10Z
<p>Wf: </p>
<hr />
<div>Did you know that Microsoft does not listen?<br />
<br />
I'll gather a few examples of frustration arising from Microsoft not listening here.<br />
= Automatically set pythonpath correctly for default project setups =<br />
1/4 million views so far approx 150 upvotes but no implementation in vscode so far:<br />
* https://stackoverflow.com/questions/53653083/how-to-correctly-set-pythonpath-for-visual-studio-code#<br />
The ticket:<br />
* https://github.com/microsoft/vscode-python/issues/22824<br />
was closed in 2024-02 without proper investigation of the needs of the customers <br />
<br />
= OS language, default language, current language, keyboard, country are ALL independent!! =<br />
Who would have believed this? Microsoft never knew since they bought Presenter from Forethought in 1987 to market it as PowerPoint. 33 years later the state of affairs is:<br />
* https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/17817385-changing-language-to-apply-to-all-slides (which will give you a 404 as of 2021-11-24)<br />
So https://web.archive.org/web/20201210133832/https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/17817385-changing-language-to-apply-to-all-slides is needed to see how many people complained about this ..<br />
<br />
= Bugreporting! What Bug reporting? =<br />
So there is a bug in your software and the software detects it. See e.g. how Powerpoint 2016 might crash:<br />
[[File:Screenshot2020-11-20.png|400px]]<br />
<br />
You even get an apology that part of your work might have been lost due to the bug.<br />
<br />
What options to report the bug and get it fixed do you get?<br />
Of course none. Why should someone want this bug to be fixed. There is a repair option that might or might not work and no need to fix or listen. Your work might be lost but so what - you are using Microsoft software and loosing your work due to bugs in Microsoft software is going to be part of your daily routine soon. Get used to it and plan for it. I wonder what the valuation of Microsoft corp would be if the company would have to pay for all the lost work that is created with bugs like the one shown above. Could well be below zero ...<br />
= Command Language in Excel =<br />
* https://superuser.com/questions/984789/change-language-of-command-in-excel<br />
''This was very useful to me, +1! It is absurd that one should change the language of all the Office package only to have the Excel formulas in English, but it's Microsoft, no surprise!''<br />
<br />
= Links in PDF Export for notes pages =<br />
Used to work and is now broken.<br />
See: <br />
* https://answers.microsoft.com/en-us/msoffice/forum/all/exporting-powerpoint-notes-pages-to-pdf-breaks/86b46877-203e-4945-b130-e3c9279e529e<br />
for how Microsoft ignores the issue<br />
The link to the uservoice mentioned in the above blog entry:<br />
* https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/42208063-please-restore-capability-to-export-save-as-pdf-no<br />
is broken.<br />
= Powerpoint number of slides =<br />
Again 33 years later no need to count automatically - let the users have some fun doing this any time they add or remove a slide:<br />
''PowerPoint can automatically add numbers to your slides, but it can't automatically show a count (such as "slide 2 of 12"). You have to do that manually. ''<br />
* https://support.microsoft.com/en-us/office/show-the-slide-number-and-total-number-of-slides-on-every-slide-e62b363a-a5c4-413e-b7b7-52c1a4d9dd02</div>
Wf
https://wiki.bitplan.com/index.php?title=PageCacheTest&diff=18419
PageCacheTest
2024-03-02T03:48:57Z
<p>Wf: modified by testCacheRefesh at2024-03-02T03:48:57Z</p>
<hr />
<div>2024-03-02T03:48:57Z</div>
Wf