-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit
- Loading branch information
0 parents
commit 99a6deb
Showing
9 changed files
with
553 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 julianhocker | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Wikidata Show | ||
This extension for mediawiki allows you to integrate data from the German national libary into your wiki. German national library has information about all books published in Germany, so this makes it easy for you to add library information to your wiki. | ||
|
||
The extension adds the following magic words to your mediawiki: | ||
* gndshowlite: takes in the p-value you want to show and only shows this information (fits great if you want to display local data from semantic mediawiki together with data from wikidata) | ||
|
||
Example: | ||
|
||
![alt text](https://raw.githubusercontent.com/julianhocker/wikidatashow/master/example.png "Example of extension") | ||
|
||
## Installation | ||
1. Add "freearhey/wikidata": "3.2" to your composer.json of the wiki in the section "require" | ||
2. Run composer update --no-dev | ||
3. Clone this repo via git clone https://github.com/julianhocker/wikidatashow.git into extensions | ||
4. Add wfLoadExtension('WikidataShow'); to your LocalSettings.php | ||
|
||
## Usage | ||
### Wikidatashow | ||
This way you get a box with all the data defined above directly from wikidata | ||
* type the magic work {{#wikidatashow:}} into a page and it will get the corresponding information based on the smw-attribute 'Wikidata ID' | ||
* you can also provide the wikidata-id directly, e.g. {{#wikidatashow:Q1533809}} | ||
|
||
###Wikidatashotlite | ||
This way you only get single items from wikidata. This function is provided for links to wikipedia, image, adress, website, link to GND | ||
* type the magic word {{#wikidatashowlite:}} to a page, giving the p-value of the information you need or 'wikipedia', e.g. {{#wikidatashowlite:P18}} to get the corresponding image. | ||
* if you do not have Semantic Mediawiki running, just provide the wikidata ID as second paramenter to get the data: | ||
{{#wikidatashowlite:P227|Q1533809}} | ||
|
||
## Dependencies | ||
The extension was tested on Semantic MediaWiki 3.1.5. and MediaWiki 1.34.0. You do not need Semantic MediaWiki to make it running, but then you have to provide the wikidata-ID directly. Translation is right now done in English and German, please feel free to add more translation ;). | ||
|
||
## Known issues | ||
* Please open issues if you encounter problems | ||
* connection to wikidata should be done more nicely in the code | ||
* I also added the magic word wikidatashoweasy, that just returns the value from wikidata. It seemed handy at first, but I did not see great usage since many values are not proper formatted/usefull in wikidata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* @license GPL-2.0-or-later | ||
* @author Julian Hocker | ||
*/ | ||
|
||
$magicWords = []; | ||
|
||
/** English | ||
* @author Julian Hocker | ||
*/ | ||
$magicWords['en'] = [ | ||
'smwshow' => [ 0, 'smwshow' ], | ||
]; | ||
|
||
/** German | ||
* @author Julian Hocker | ||
*/ | ||
$magicWords['de'] = [ | ||
'smwshow' => [ 0, 'smwshow' ], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="WEB_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$" /> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "SMWShow", | ||
"author": "Julian Hocker", | ||
"version": "0.2", | ||
"url": "https://github.com/julianhocker/WikidataShow", | ||
"descriptionmsg": "desc", | ||
"license-name": "MIT License", | ||
"type": "parserhook", | ||
"MessagesDirs": { | ||
"SMWShow": [ | ||
"i18n" | ||
] | ||
}, | ||
"AutoloadClasses": { | ||
"SMWShowHooks": "src/SMWShowHooks.php" | ||
}, | ||
"ExtensionMessagesFiles": { | ||
"SMWShowMagic": "SMWShow.i18n.php" | ||
}, | ||
"Hooks": { | ||
"ParserFirstCallInit": "GNDShowHooks::onParserFirstCallInit" | ||
}, | ||
"manifest_version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ "@metadata": { | ||
"authors": [ | ||
"Julian Hocker" | ||
] | ||
}, | ||
"desc": "Diese Extension erlaubt das Anzeigen von Informationen aus Wikidata", | ||
"website": "Webseite", | ||
"adress": "Adresse", | ||
"gndlink": "DNB-Link", | ||
"image": "Bild", | ||
"instance": "Ist ein", | ||
"founded": "Gegründet", | ||
"names": "Namen", | ||
"wikipedia": "Wikipedia-Seite", | ||
"map": "Karte", | ||
"language": "de", | ||
"operator": "Betreiber" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ "@metadata": { | ||
"authors": [ | ||
"Julian Hocker" | ||
] | ||
}, | ||
"desc": "This extension shows data from wikidata", | ||
"website": "Website", | ||
"adress": "Adress", | ||
"gndlink": "GND link", | ||
"image": "Image", | ||
"instance": "Instance", | ||
"founded": "Founded", | ||
"names": "Names", | ||
"wikipedia": "Wikipedia page", | ||
"map": "Map", | ||
"language": "en", | ||
"operator": "operator" | ||
} |
Oops, something went wrong.