Extension talk:LinkedWiki
This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
XML error: "Undeclared entity warning" at line 174 (parsing as UTF-8)
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hello. When I try a local query:
{{#sparql:select * where { ?x ?y ?z .} LIMIT 5|debug=yes}}
I can get this error: Error #sparql :Array
Also I could get the following data (touching some code for debugging):
=====LinkedWiki: Using ARC2_SPARQLXMLResultParser =====Linked wiki Error: Array (
[0] => Array ( [0] => XML error: "Undeclared entity warning" at line 174 (parsing as UTF-8) )
)
Can you give some line about that?
Thanks.
- Fernando Carpani Fernando Carpani (talk) 23:11, 6 July 2011 (UTC)
- Hi I see only now your message :(
- Sorry !
- You can now use the google group : http://groups.google.com/group/linkedwiki
- You are again this problem ?
- Regards
- Karima Karima Rafes 14:58, 1 October 2011 (UTC)
Unexpected non-MediaWiki exception while saving a page
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hello!
I get the follwing exception when I try to save a page to my wiki (MediaWiki 1.17,SMW 1.5.6, LinkedWiki 0.1.0, PHP 5.3.2).
My sparql endpoint is local and works fine.
Unexpected non-MediaWiki exception encountered, of type "Exception" exception 'Exception' with message '0-- 1--Error unknown. ' in /var/www/vhosts/..../extensions/LinkedWiki/lib/4store/SparqlTools.php:111 Stack trace: #0 /var/www/vhosts/..../extensions/LinkedWiki/class/SMW_LinkedWikiStore.php(113): SparqlTools::insert('<http://example...', 'http://sci-clas...', 'http://sci-clas...', NULL) #1 /var/www/vhosts/..../extensions/LinkedWiki/class/SMW_LinkedWikiStore.php(75): SMW_LinkedWikiStore->_update(Object(SMWSemanticData)) #2 /var/www/vhosts/..../extensions/SemanticMediaWiki/includes/SMW_ParseData.php(252): SMW_LinkedWikiStore->updateData(Object(SMWSemanticData)) #3 /var/www/vhosts/...../extensions/SemanticMediaWiki/includes/SMW_ParseData.php(406): SMWParseData::storeData(Object(ParserOutput), Object(Title), true) #4 [internal function]: SMWParseData::onLinksUpdateConstructed(Object(LinksUpdate)) #5 /var/www/vhosts/..../includes/Hooks.php(158): call_user_func_array(Array, Array) #6 /var/www/vhosts/..../includes/LinksUpdate.php(83): wfRunHooks('LinksUpdateCons...', Array) #7 /var/www/vhosts/..../includes/Article.php(3646): LinksUpdate->__construct(Object(Title), Object(ParserOutput)) #8 /var/www/vhosts/..../includes/Article.php(2225): Article->editUpdates('{{#sparql:selec...', '', false, '20110708102128', 14, true) #9 /var/www/vhosts/..../includes/Article.php(1976): Article->doEdit('{{#sparql:selec...', '', 98) #10 /var/www/vhosts/.../includes/EditPage.php(1076): Article->updateArticle('{{#sparql:selec...', '', false, false, false, '') #11 /var/www/vhosts/.../includes/EditPage.php(2656): EditPage->internalAttemptSave(false, false) #12 /var/www/vhosts/.../includes/EditPage.php(415): EditPage->attemptSave() #13 /var/www/vhosts/.../includes/EditPage.php(296): EditPage->edit() #14 /var/www/vhosts/.../includes/Wiki.php(522): EditPage->submit() #15 /var/www/vhosts/.../includes/Wiki.php(69): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest)) #16 /var/www/vhosts/.../index.php(114): MediaWiki->performRequestForTitle(Object(Title), Object(Article), Object(OutputPage), Object(User), Object(WebRequest)) #17 {main}
But, even though I get this exeption, if I go back to my page, the queries are ok and the expected results are presented.
What'swrong?
Thank you in advance! 89.233.55.64 (talk) 10:40, 12 July 2011 (UTC)
- Well, it works if you put in comment the following line:
- //$smwgDefaultStore = "SMW_LinkedWikiStore"; Anastasia 14:32, 14 July 2011 (UTC)
- Hi
- I see only now your message :(
- Sorry !
- You can now use the google group : http://groups.google.com/group/linkedwiki
- Regards
- Karima Karima Rafes 14:56, 1 October 2011 (UTC)
Statistics
edithttp://stats.grok.se/www.w/201111/Extension:LinkedWiki
http://stats.grok.se/www.w/201112/Extension:LinkedWiki
http://stats.grok.se/www.w/201201/Extension:LinkedWiki
http://stats.grok.se/www.w/201202/Extension:LinkedWiki
http://stats.grok.se/www.w/201203/Extension:LinkedWiki
http://stats.grok.se/www.w/201204/Extension:LinkedWiki
http://stats.grok.se/www.w/201205/Extension:LinkedWiki Karima Rafes (talk) 05:52, 10 December 2011 (UTC)
Lien de téléchargement incorrect
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Le lien de téléchargement de l'extension "https://github.com/BorderCloud/LinkedWiki/downloads" m'affiche un message d'erreur : "There aren’t any uploads for this repository."
Je pense l'avoir quand même récupéré avec le même lien (https://github.com/BorderCloud/LinkedWiki) et en cliquant sur le bouton "ZIP" pour charger les fichiers.
Cdt, Antoine Dubouis 164.131.224.225 (talk) 13:15, 8 March 2013 (UTC)
- Rydw i wedi cywiro'r ddolen. [[kgh]] (talk) 21:17, 8 March 2013 (UTC)
- C'est bon, Antoine ? Karima Rafes (talk) 10:56, 24 March 2013 (UTC)
Notice: Undefined index: Beschrijving in /var/www/wikifarm-mw1.19/extensions/LinkedWiki/LinkedWiki.php on line 283
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
When I do a query as follows
{{#sparql: PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX gemma:<http://model.i-catalogus.nl/gemma/> PREFIX foaf:<http://xmlns.com/foaf/0.1/> PREFIX purl:<http://purl.org/dc/terms/> SELECT ?Softwareproduct ?Naam ?Homepage ?WordtGeleverdDoor ?HomePageLeverancier ?Beschrijving WHERE { ?Softwareproduct rdf:type gemma:SoftwareProduct . ?Softwareproduct rdfs:label ?Naam . ?Softwareproduct foaf:homepage ?Homepage . ?Softwareproduct gemma:wordtGeleverdDoor ?Leverancier . ?Leverancier rdfs:label ?WordtGeleverdDoor . ?Leverancier foaf:homepage ?HomePageLeverancier . ?Softwareproduct purl:description ?Beschrijving } |endpoint=http://sparql.i-catalogus.nl/|headers=Softwareproduct, Geleverd door, Beschrijving|templates=ToonSoftwareproduct, ToonGeleverdDoor,ToonSoftwareproductBeschrijving}}
I get a notice like:
Notice: Undefined index: Beschrijving in /var/www/wikifarm-mw1.19/extensions/LinkedWiki/LinkedWiki.php on line 283
This has probably something to do with empty values. If more cells are empty then the notice is repeated. Toine Schijvenaars (talk) 14:41, 30 August 2013 (UTC)
- Hi, I look it today. Karima Rafes (talk) 08:02, 7 September 2013 (UTC)
- The parser PHP (xml_parse function) said : Invalid character.
- In the sparql result, there are strange characters in XML (start with e-) :
<result> <binding name="Softwareproduct"><uri>http://model.i-catalogus.nl/gemma/SoftwareProduct/Liaan_e-Dienstverlening</uri></binding> <binding name="Naam"><literal>Liaan e-Dienstverlening</literal></binding> <binding name="Homepage"><literal>http://www.liaan.nl/produkten/produkt_info.php?id=22</literal></binding> <binding name="WordtGeleverdDoor"><literal>Liaan</literal></binding> <binding name="HomePageLeverancier"><literal>http://www.liaan.nl</literal></binding> <binding name="Beschrijving"><literal>Het product Liaan e-Dienstverlening is ontwikkeld om uw organisatie uitgebreid te ondersteunen bij het implementeren van digitale dienstverlening / e-Formulieren. Met een abonnement op Liaan e-Dienstverlening beschikt u over alle benodigde middelen om e-Formulieren te ontwikkelen en te integreren in uw website en dus beschikbaar te stellen aan de inwoners van uw gemeente. Ook kunt u e-Producten beschikbaar stellen aan uw frontoffice (Servicecenter) of backoffice. Het product beschikt over de noodzakelijke voorzieningen zoals DigiD ondersteuning (voorzien van de benodigde PKIOverheidscertificaten, voorinvulling (zoals GBAV, DKD) en (StuF)berichtenverkeer. Technische kennis is niet vereist, installatie niet nodig: Liaan e-Dienstverlening wordt volledig gehost in onze e-loket.nl infrastructuur. Binnen deze infrastructuur beheert u al uw e-Formulieren met behulp van de zeer gebruiksvriendelijke webapplicatie e-Beheer.</literal></binding> </result>
- You have to fix the format in your triplestore.
- Bye. Karima Rafes (talk) 14:32, 7 September 2013 (UTC)
Result page Hyperlinks v2.1.0
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I upgraded to version 2.1.0 and now the page hyperlinks are not available in the results. Is there a way to get them back? Legaulph (talk) 15:54, 6 December 2014 (UTC)
Download CSV with url in the results
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I'm getting "<a href=“http://sitename/index.php/Special:URIResolver" with the page links in the results Legaulph (talk) 15:30, 24 October 2016 (UTC)
- It's probably an old version. Can you use the last version of this extension for your Wiki ? Karima Rafes (talk) 16:07, 24 October 2016 (UTC)
- Thanks for the quick response, I thought I had the latest version.
- Now the query does not work correctly.
<!--TECHNOLOGY ROADMAP END--> <!--STANDARD CATEGORY BEGIN--> {{#ifeq: {{{cat|}}} | Standard | {{#sparql: PREFIX property:<http://server/index.php/Special:URIResolver/Property-3A> PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?Name ?Owner ?Publication_Status ?Link WHERE { ?Link ?p ?cat . ?cat rdfs:label ?Category . ?cat rdfs:label "Standard" . FILTER(CONTAINS(STR(?cat), "Category")) . ?Link property:Has_Name ?Name . FILTER regex(?Name, "{{{standard|}}}", "i") . ?Link property:PublicationStatus ?Publication_Status . {{#if: {{{standard_owner|}}} | ?Link property:OwnedBy ?Owner . FILTER regex(?Owner, "{{{standard_owner|}}}", "i") . | OPTIONAL { ?Link property:OwnedBy ?Owner .} }} {{#if: {{{standard_contact|}}} | ?Link property:Contact ?Contact . FILTER regex(?Contact, "{{{standard_contact|}}}", "i") . | OPTIONAL { ?Link property:Contact ?Contact . } }} } ORDER BY ?Name LIMIT 1000000 |endpoint=http://server:8080/db1/sparql}} | }} <!--STANDARD CATEGORY END-->
- Error http_response_code: 200 Error message: Error parsing XML result:Not well-formed (invalid token) Response : {
- This has been working fine until I'm trying to upgrade to mw 1.27, SMW 2.4.1
- the display result was ok until I upgraded LinkedWiki just now, now I get the above error. Legaulph (talk) 17:03, 24 October 2016 (UTC)
- I have a new install of mediawiki 1.28.0
getting error - Notice: Undefined variable: wgResourceModules in /app/datamap/mw/extensions/LinkedWiki/LinkedWiki.php on line 72
- Fatal error: Unsupported operand types in /app/datamap/mw/extensions/LinkedWiki/LinkedWiki.php on line 72 Legaulph (talk) 15:03, 7 December 2016 (UTC)
- Ok I look the problem this weekend.
- Karima Karima Rafes (talk) 13:48, 8 December 2016 (UTC)
- wgResourceModules is not in the last version.
- Can you test with the last version ?
- I test your precedent query. (sorry I didn't see this message before)
- It works with my database.
- What is your database ? Probably, there is a problem of configuration.[1] If your database have a extern IP, I can try to test.
- [1] https://www.mediawiki.org/wiki/Extension:LinkedWiki/Configuration
- Bye
- Karima Karima Rafes (talk) 19:49, 10 December 2016 (UTC)
- Undefined variable:
- Is fixed now
- For some reason this no longer works
- Legaulph (talk) 13:56, 13 December 2016 (UTC)
{{#ifeq: {{{cat|}}} | Standard | {{#sparql: PREFIX property:<http://server/index.php/Special:URIResolver/Property-3A> PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?Name ?Owner ?Publication_Status ?Link WHERE { ?Link ?p ?cat . ?cat rdfs:label ?Category . ?cat rdfs:label "Standard" . FILTER(CONTAINS(STR(?cat), "Category")) . ?Link property:Has_Name ?Name . FILTER regex(?Name, "{{{standard|}}}", "i") . ?Link property:PublicationStatus ?Publication_Status . {{#if: {{{standard_owner|}}} | ?Link property:OwnedBy ?Owner . FILTER regex(?Owner, "{{{standard_owner|}}}", "i") . | OPTIONAL { ?Link property:OwnedBy ?Owner .} }} {{#if: {{{standard_contact|}}} | ?Link property:Contact ?Contact . FILTER regex(?Contact, "{{{standard_contact|}}}", "i") . | OPTIONAL { ?Link property:Contact ?Contact . } }} } ORDER BY ?Name LIMIT 1000000 |endpoint=http://server:8080/db1/sparql}} | }}
Query not working in MW 1.28.0
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I'm running some more test and have come up with this issue. I have for a current versions
MediaWiki 1.25.5
Semantic MediaWiki 2.3
Page Forms 4.0.2-alpha
LinkedWiki 2.1.0 alpha 1
Query that works in these versions
{{#sparql:
PREFIX property:<http://server.com/index.php/Special:URIResolver/Property-3A>
PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?manufacturer ?start_date ?end_date
WHERE
{
?s ?p ?sub .
?cat rdfs:label ?Category .
?cat rdfs:label "Technology" .
FILTER(CONTAINS(STR(?cat), "Category")) .
?sub rdfs:subClassOf ?cat .
?sub rdfs:label ?Subcategory .
?s property:Has_Name ?name .
?s property:Has_subobject ?subobject .
?subobject property:Has_Version ?version .
?subobject property:Technology_Name ?technology_name .
?subobject property:Has_Support_Status ?support_status .
?subobject property:Has_Start_Date ?start_date .
?subobject property:Has_End_Date ?end_date .
?subobject property:Supported_By ?supported_by .
?s property:OwnedBy ?owner.
?s property:PublicationDate ?publication_date .
?s property:PublicationStatus ?publication_status .
?s property:ManufacturedBy ?manufacturer.
OPTIONAL {
?s property:Contact ?contact.
}
}
ORDER BY ?name
LIMIT 1000000
|endpoint=http://server:8080/dev/sparql}}
Does not work in these versions:
MediaWiki 1.28.0
Semantic MediaWiki 2.4.4
Page Forms 4.0.2-alpha
LinkedWiki 3.0.0 Alpha (bec49e4)
} ORDER BY ?name LIMIT 10 Error endpoint: http://server:8080/db1/sparql Error http_response_code: 200 Error message: Error parsing XML result:Not well-formed (invalid token) Response : { Legaulph (talk) 13:28, 15 December 2016 (UTC)
- What is the name and the version of your database ? It's the same version between the two tests ?
- Can you execute this command ?
- ./sparql/query -v -d -r -e http://server:8080/dev/sparql -f yourQuery.rq
- I think your database sends a json and not a XML.
- I need to check if the parameter accept=application/sparql-results+xml is in the HTTP's header. This command can print the header in the log. (I think...)
- Thanks
- Karima Karima Rafes (talk) 16:48, 15 December 2016 (UTC)
- Yes the same version and actually the same server
- Apache Jena Fuseki
- Version 2.3.0. Legaulph (talk) 19:27, 15 December 2016 (UTC)
- Ok I found the problem.
- I disabled an old fix for Fuseki. I thought this difference in the protocol was from the past but the problem of content negotiation is always present.
- Sorry. Now, you can download the last version in the master.
- Karima Karima Rafes (talk) 20:25, 17 December 2016 (UTC)
- Thank you 148.177.1.212 (talk) 18:32, 20 December 2016 (UTC)
- Hi Karima,
- Maybe I'm doing something wrong
- Still getting the error:
Error http_response_code: 200 Error message: Error parsing XML result:Not well-formed (invalid token) Response :
- Query is a simple one
{{#sparql: PREFIX property:<http://server.com/index.php/Special:URIResolver/Property-3A> PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?name WHERE { ?s property:Has_Name ?name . } LIMIT 15 |endpoint=http://server.com:8080/ds/sparql}} }}
- I have added to the extension.json
- Legaulph (talk) 12:43, 21 December 2016 (UTC)
"http://server.com": { "endpoint": "http://server.com:8080/ds/sparql", "typeRDFDatabase": "fuseki", "HTTPMethodForQuery": "GET" },
- Have you update the extension ?
- You can check if you have the last version in the file : endpoint.php
- See the last update in the file endpoint
- If you want to do a query with your configuration in the file extension.json, you can write :
{{#sparql: select * where { ?x ?y ?z . } LIMIT 15 |config=http://server.com }}
- (the special page : SPARQL editor helps to test your configuration)
- Bye Karima Rafes (talk) 13:29, 21 December 2016 (UTC)
- I had to remove
"typeRDFDatabase": "fuseki",
- Thanks Legaulph (talk) 13:41, 21 December 2016 (UTC)
Exception encountered, of type "ConfigException"
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
We get an error about media wiki not beeing able to find the configuration parameters as expected, when saving a page
Exception encountered, of type "ConfigException"
[31907a3f] /index.php?title=…&action=submit ConfigException from line 53 of /srv/www/…/includes/config/GlobalVarConfig.php: GlobalVarConfig::get: undefined option: 'endpointDefault' Backtrace: #0 /srv/www/…/extensions/LinkedWiki/parser/SparqlParser.php(29): GlobalVarConfig->get(string) #1 [internal function]: SparqlParser::render(Parser, string, string) …
We get a similar error for the Special:LinkedWikiConfig page just with:
… [90d212b0] /Special:LinkedWikiConfig ConfigException from line 53 of /srv/www/…/includes/config/GlobalVarConfig.php: GlobalVarConfig::get: undefined option: 'endpoint' …
We have the extension.json at its original place. 2001:638:902:200B:3C29:9F63:C644:4361 (talk) 15:56, 21 February 2017 (UTC)
- It is MediaWiki 1.25.2 and LinkedWiki Extension 3.0.0 Alpha 2001:638:902:200B:3C29:9F63:C644:4361 (talk) 16:00, 21 February 2017 (UTC)
- By default the endpointDefault is "http://www.wikidata.org". If you change this value, you need to insert, a new endpoint in the list. For exemple :
- "endpointDefault": "http://myendpoint.org",
- So in list of endpoints, you have to add your default endpoint (with the good config ) :
- "endpoint": {
- ...
- "http://myendpoint.org": {
- "isReadOnly": true,
- ...
- "endpoint": "http://myendpoint.org/sparql",
- ...
- "storageMethodClass": "SimpleStorageMethod"
- },
- }
- If you have again a problem: send me a copy of you extension.json by email to karima.rafes@gmail.com
- Bye
- Karima Karima Rafes (talk) 16:34, 21 February 2017 (UTC)
Installation break properties
editMediaWiki 1.28.0
PHP 5.6.28 (fpm-fcgi)
MySQL 5.6.34
ICU 52.1
Lua 5.1.5
Page Forms 4.1 (22cc121) 15:25, 9 March 2017
Semantic MediaWiki 2.5.0
When I install LinkedWiki (v3.0.0), all of the links in Special:Properties turn red and no new properties show up in Special:Properties upon creation with Special:CreateProperty. As soon as I remove wfLoadExtension( 'LinkedWiki' ); from LocalSettings, the properties work again... Gstupp (talk) 18:53, 16 March 2017 (UTC)
- See https://phabricator.wikimedia.org/T160665 Karima Rafes (talk) 08:58, 17 March 2017 (UTC)
- I believe that the solution should somehow also be documented on the extensions page. [[kgh]] (talk) 10:30, 19 March 2017 (UTC)
Upgrading MW1.3.0 and SMW2.5.5
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Product Version
MediaWiki 1.30.0 PHP 7.1.8 (apache2handler) MySQL 5.6.34-log Semantic MediaWiki 2.5.5 LinkedWiki --> 3.1.1 Apache Jena Fuseki 2.5.0
Using the same query as previous post I get no results {{#sparql: PREFIX property:<http://server.com/index.php/Special:URIResolver/Property-3A> PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?manufacturer ?start_date ?end_date WHERE { ?s ?p ?sub . ?cat rdfs:label ?Category . ?cat rdfs:label "Technology" . FILTER(CONTAINS(STR(?cat), "Category")) . ?sub rdfs:subClassOf ?cat . ?sub rdfs:label ?Subcategory . ?s property:Has_Name ?name . ?s property:Has_subobject ?subobject . ?subobject property:Has_Version ?version . ?subobject property:Technology_Name ?technology_name . ?subobject property:Has_Support_Status ?support_status . ?subobject property:Has_Start_Date ?start_date . ?subobject property:Has_End_Date ?end_date . ?subobject property:Supported_By ?supported_by . ?s property:OwnedBy ?owner. ?s property:PublicationDate ?publication_date . ?s property:PublicationStatus ?publication_status . ?s property:ManufacturedBy ?manufacturer. OPTIONAL { ?s property:Contact ?contact. } } ORDER BY ?name LIMIT 1000000 |endpoint=http://server:8080/dev/sparql}}Legaulph (talk) 13:04, 18 January 2018 (UTC)
- You can test your query via the SPARQL editor (special page).
- Extension:LinkedWiki/SPARQL editor
- Or you can see the problem in the page with the log level. Karima Rafes (talk) 13:22, 18 January 2018 (UTC)
- Legaulph (talk) 14:24, 18 January 2018 (UTC)
I tried | log=2 and nothing returns. Extension:LinkedWiki/SPARQL editor: does not exist in my wiki Sparql Flint editor gives: Flint Error -> Classes cannot be retrieved. HTTP Status: 0, RDF test cases gives error: RDFUnit is not installed. Then I tried Sparql Query interface and get: Array ( [0] => Error query : PREFIX property: PREFIX swivt: PREFIX rdfs: PREFIX xsd: SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?manufacturer ?start_date ?end_date WHERE { ?s ?p ?sub . ?cat rdfs:label ?Category . ?cat rdfs:label "Technology" . FILTER(CONTAINS(STR(?cat), "Category")) . ?sub rdfs:subClassOf ?cat . ?sub rdfs:label ?Subcategory . ?s property:Has_Name ?name . ?s property:Has_subobject ?subobject . ?subobject property:Has_Version ?version . ?subobject property:Technology_Name ?technology_name . ?subobject property:Has_Support_Status ?support_status . ?subobject property:Has_Start_Date ?start_date . ?subobject property:Has_End_Date ?end_date . ?subobject property:Supported_By ?supported_by . ?s property:OwnedBy ?owner. ?s property:PublicationDate ?publication_date . ?s property:PublicationStatus ?publication_status . ?s property:ManufacturedBy ?manufacturer. OPTIONAL { ?s property:Contact ?contact. } } ORDER BY ?name LIMIT 1000000 |endpoint=http://awsacrnva1061.jnj.com:8080/dev/sparql}} Error endpoint: Error http_response_code: 0 Error message: Error number: 3 Error message: malformed [1] => Error query : PREFIX property: PREFIX swivt: PREFIX rdfs: PREFIX xsd: SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?manufacturer ?start_date ?end_date WHERE { ?s ?p ?sub . ?cat rdfs:label ?Category . ?cat rdfs:label "Technology" . FILTER(CONTAINS(STR(?cat), "Category")) . ?sub rdfs:subClassOf ?cat . ?sub rdfs:label ?Subcategory . ?s property:Has_Name ?name . ?s property:Has_subobject ?subobject . ?subobject property:Has_Version ?version . ?subobject property:Technology_Name ?technology_name . ?subobject property:Has_Support_Status ?support_status . ?subobject property:Has_Start_Date ?start_date . ?subobject property:Has_End_Date ?end_date . ?subobject property:Supported_By ?supported_by . ?s property:OwnedBy ?owner. ?s property:PublicationDate ?publication_date . ?s property:PublicationStatus ?publication_status . ?s property:ManufacturedBy ?manufacturer. OPTIONAL { ?s property:Contact ?contact. } } ORDER BY ?name LIMIT 1000000 |endpoint=http://server.com:8080/dev/sparql}} Error endpoint: Error http_response_code: 200 Error message: Error parsing XML result:Invalid document end Response : )
- I also get this [WmCwqj5oEE9sAnCYT03MSgAAAAo] 2018-01-18 14:35:23: Fatal exception of type "Exception" Legaulph (talk) 14:35, 18 January 2018 (UTC)
- RDFUnit is experimental for the moment. It's disable by default.
- You need to re-install the extension. There are missing files.
- Upload files here (backup before your precedent extension.json) :
- Special:ExtensionDistributor/LinkedWiki Karima Rafes (talk) 14:36, 18 January 2018 (UTC)
- I don't see the special page SPARQL Editor Legaulph (talk) 16:02, 18 January 2018 (UTC)
- Found it Legaulph (talk) 16:03, 18 January 2018 (UTC)
- Results are the same Legaulph (talk) 16:09, 18 January 2018 (UTC)
- Sorry I cannot test your endpoint but it works on my wiki with the same configuration.
- http://daap.eu/wiki/User:Karima_Rafes Karima Rafes (talk) 16:45, 18 January 2018 (UTC)
- Hi Karima,
Thank you for your help I was missing some things and also had a typo.
Everything is working now.
Legaulph (talk) 14:27, 19 January 2018 (UTC)- Great ! Bye. Karima Rafes (talk) 14:29, 19 January 2018 (UTC)
query with LIMIT 7500
editI get error:
Category: Pages where template include size is exceeded. Is there a way to get more results?
Thanks Legaulph (talk) 13:26, 21 January 2018 (UTC)
- May be with the parameter cache. You can disable the cache with the cache parameter.
- An example :
- {{#sparql:select * where { ?x ?y ?z . } LIMIT 5|endpoint=https://query.wikidata.org/sparql|cache=no}}
- Else this probably a limit in the options of Mediawiki.
- Another solution (in last version), your can use a visualization with datatable. The page will be in cache but the navigator will send the query at each time (and without limit).
- {{#sparql: select * where { ?x ?y ?z . } LIMIT 15 |endpoint=https://query.wikidata.org/sparql |chart=bordercloud.visualization.DataTable |options=width=100%!height=500px }} Karima Rafes (talk) 17:02, 21 January 2018 (UTC)
- It is a MediaWiki issue.
- is there a way to get the display LIMIT 15 and the csv to export everything? Legaulph (talk) 11:20, 22 January 2018 (UTC)
- The export in csv is different between databases. For the moment, I convert the HTML table in CSV.
- You can make a template with a link with good parameters for your database.
- If you want generate a link/request by this extension, you can propose a feature and share your link for your database (for example) in the project:
- https://phabricator.wikimedia.org/tag/mediawiki-extensions-linkedwiki/
- (the database has always a limit. This new feature has to use limit and offset in a script php or javascript) Karima Rafes (talk) 12:59, 22 January 2018 (UTC)
- Adding this feature would be greate.
- The option to preview - limit 15,
- download full results in csv, json, rdf.
- I do not have access to fabricator to request these features. Legaulph (talk) 14:02, 22 January 2018 (UTC)
- You can login you with your account mediawiki. Karima Rafes (talk) 16:18, 22 January 2018 (UTC)
Fatal exception of type "MWException"
edit- Product Version
- MediaWiki 1.30.0
- PHP 7.1.8 (apache2handler)
- MySQL 5.6.34-log
- Semantic MediaWiki 2.5.5
- LinkedWiki --> 3.1.1
- Apache Jena Fuseki 2.5.0
- I'm seeing this error
/* [WmSRZ1TLdhLyhXELv3urDAAAAAg] 2018-01-21 13:11:03: Fatal exception of type "MWException"
- /
if (window.console && console.error) {console.error("[WmSRZ1TLdhLyhXELv3urDAAAAAg] 2018-01-21 13:11:03: Fatal exception of type \"MWException\"");} mw.loader.implement("ext.LinkedWiki.SparqlParser@0y9y0vq",function($,jQuery,require,module){$(document).ready(function(){sgvizler2.containerDrawAll({googleApiKey:googleApiKey,osmAccessToken:osmAccessToken,path:mw.config.get('wgScriptPath')+"/extensions/LinkedWiki/node_modules/sgvizler2/build/browser"});});}); mw.loader.state({"ext.LinkedWiki.sgvizler2":"error"}); Legaulph (talk) 11:16, 29 January 2018 (UTC)
- Have you insert your keys in the file keys.js ? Karima Rafes (talk) 15:38, 29 January 2018 (UTC)
- Can I disable the google maps sense I don't use it? Legaulph (talk) 13:43, 12 March 2018 (UTC)
- Normally, sgvizler2 downloads only libs used by the charts in the page. If you don't want use Google and OSM Map, you have always this error ? Karima Rafes (talk) 15:05, 12 March 2018 (UTC)
- Is it correct that if you don't want to use Google and OSM, you just set the keys to null? Leaving them commented out gives this error. Josephguillaume (talk) 11:19, 20 January 2019 (UTC)
Warnings when running 'yarn install --production=true'
editUsing
- Debian GNU/Linux 9.5
- Mediawiki 1.31.0
- LinkedWiki 3.1.1
- https://nodejs.org/en/10.7.0
- yarn 1.7.0
- Composer version 1.6.5 2018-05-04 11:44:59
$ yarn install --production=true yarn install v1.7.0 info No lockfile found. [1/4] Resolving packages... ⠁ (node:18055) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. warning grunt > coffee-script@1.10.0: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) warning grunt-jsonlint > jsonlint > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info. [2/4] Fetching packages... [3/4] Linking dependencies... warning " > bootstrap@4.1.2" has unmet peer dependency "jquery@1.9.1 - 3". [4/4] Building fresh packages... success Saved lockfile. Done in 1.35s.
----
How to resolve these warnings? Will the LinkedWiki work or be broken if these warnings are not resolved? Jukeboksi (talk) 20:01, 23 July 2018 (UTC)
- Only the special page "SPARQL editor" works with boostrap. It is "experimental". It works correctly with Chrome but I didn't test with other navigators :-/
- I will try to resolve these problems at the next update of the special page. Karima Rafes (talk) 21:18, 23 July 2018 (UTC)
- I did the following:
yarn add jquery # dependency of bootstrap yarn add popper.js # dependency of bootstrap yarn add bootstrap@4.1.2 yarn install --production=true
- Should the SPARQL editor work now? Jukeboksi (talk) 10:10, 24 July 2018 (UTC)
- I didn't test with these version. (JQuery is already in Mediawiki)
- Say me if you see a bug. Karima Rafes (talk) 20:36, 25 July 2018 (UTC)
SPARQL query inside Lua module
editHi. I want to know how to make a SPARQL query, from a Lua module, if it is possible. I read Extension:LinkedWiki/lua but it says nothing about that. Thanks. --Tinker Bell ★ ♥ 20:52, 2 December 2019 (UTC)
- Hello
- For the moment, it's not possible but it's simple to insert this new function.
- For SPARQL select and update ? Karima Rafes (talk) 09:24, 3 December 2019 (UTC)
- I just want to make a query to Wikidata from my own wiki. --Tinker Bell ★ ♥ 05:35, 5 December 2019 (UTC)
- I will develop this feature at the next update (6-12 months) or you can send me the code. Karima Rafes (talk) 14:09, 8 December 2019 (UTC)
Trying to upgrade to mediawiki 1.34.0
editRESOLVED | |
Update template in chef scripts |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
- MediaWiki 1.33.2
- PHP 7.1.30 (apache2handler)
- MySQL 5.6.10
- Semantic MediaWiki 3.1.3
- installed the latest Linked wiki
- /index.php?title=Special:UserLogin&returnto=Main+Page&returntoquery= MWException from line 183 of includes/MagicWord.php: Error: invalid magic word 'sparql'
- Trying to install yarn:
- Error: Package: yarn-1.21.1-1.noarch (yarn)
Requires: nodejs Legaulph (talk) 12:30, 4 February 2020 (UTC)
- OK
- I have installed MediaWiki 1.33.2 and ran update.php
- I was able to install yarn and follow the install procedure. Legaulph (talk) 18:58, 4 February 2020 (UTC)
- I found the issue, has to do with chef scripts I use Legaulph (talk) 12:02, 6 February 2020 (UTC)
No visualization for pictures available
editRESOLVED | |
The parameter options can be use to visualize pictures, videos, etc.
Example, here for pictures in the column[2] : {{#sparql:PREFIX p: <http://www.wikidata.org/prop/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX pq: <http://www.wikidata.org/prop/qualifier/> PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wd: <http://www.wikidata.org/entity/> SELECT DISTINCT ?nobelLabel ?winnerLabel ?image WHERE { ?winner wdt:P31 wd:Q5 ; wdt:P18 ?image ; wdt:P166 ?nobel . ?nobel wdt:P279 wd:Q7191 . ?winner p:P166 ?statement . ?statement pq:P585 ?when . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } FILTER(YEAR(?when) = 2019) } ORDER BY DESC(?year) ?nobelLabel ?winnerLabel limit 100 | endpoint = https://query.wikidata.org/sparql | chart=bordercloud.visualization.DataTable | options=colstyle=col2_img_max-width:175px; | log=2 }} Doc : https://bordercloud.github.io/sgvizler2/tutorial-bordercloud_visualization_DataTable.html |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
No visualization for pictures in version 3.3.7 available, DataTable or Google Table show the URL's only. Would it be possible in future versions? S0ring (talk) 14:50, 5 March 2020 (UTC) It works in this version but there is still work to improve ergonomics.
You can test with this query :
{{#sparql:PREFIX p: <http://www.wikidata.org/prop/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX pq: <http://www.wikidata.org/prop/qualifier/> PREFIX bd: <http://www.bigdata.com/rdf#> PREFIX wikibase: <http://wikiba.se/ontology#> PREFIX wd: <http://www.wikidata.org/entity/> SELECT DISTINCT ?nobelLabel ?winnerLabel ?image WHERE { ?winner wdt:P31 wd:Q5 ; wdt:P18 ?image ; wdt:P166 ?nobel . ?nobel wdt:P279 wd:Q7191 . ?winner p:P166 ?statement . ?statement pq:P585 ?when . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } FILTER(YEAR(?when) = 2019) } ORDER BY DESC(?year) ?nobelLabel ?winnerLabel limit 100 | endpoint = https://query.wikidata.org/sparql | chart=bordercloud.visualization.DataTable | options=colstyle=col2_img_max-width:175px; | log=2 }}
source : https://linkedwiki.com/query/List_of_Nobel_Prize_2019
Documentation with DataTable : https://bordercloud.github.io/sgvizler2/tutorial-bordercloud_visualization_DataTable.html
Bye Karima Rafes (talk) 15:32, 5 March 2020 (UTC)
- Great, your example works! But if you add a new column, it won't work:
SELECT DISTINCT ?nobelLabel ?winnerLabel ?gndid ?image WHERE {
?winner wdt:P31 wd:Q5 ;
wdt:P18 ?image ;
wdt:P166 ?nobel ;
wdt:P227 ?gndid.
?nobel wdt:P279 wd:Q7191 .
?winner p:P166 ?statement .
?statement pq:P585 ?when .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
FILTER(YEAR(?when) = 2019)
}
ORDER BY DESC(?year) ?nobelLabel ?winnerLabel
S0ring (talk) 16:37, 5 March 2020 (UTC)- You must to change the column in the options if you change the output.
- In my request, image is in the column 2 :
- options=colstyle=col2_img_max-width:175px;
- In your request, image is in the column 3 :
- options=colstyle=col3_img_max-width:175px; Karima Rafes (talk) 17:01, 5 March 2020 (UTC)
- Thank you Karima! Great extension! S0ring (talk) 12:03, 6 March 2020 (UTC)
- Thanks !
- Bye ;) Karima Rafes (talk) 12:32, 6 March 2020 (UTC)
LinkedWiki vs. SparqlCharts
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Does Extension:LinkedWiki suppose to replace Extension:SparqlCharts? Which differences exist between these extensions? S0ring (talk) 12:31, 6 March 2020 (UTC)
- Each extension has its own life.
- Differences : a lot of features...
- You can read the list of features, here : https://www.mediawiki.org/wiki/Extension:LinkedWiki
- If you want add a new visualization, you can propose it here : https://github.com/BorderCloud/sgvizler2 Karima Rafes (talk) 12:50, 6 March 2020 (UTC)
Query page using linked wiki
editMediaWiki 1.31.6
PHP 7.3.15 (cgi-fcgi) MySQL 5.6.41-log LinkedWiki 3.3.7
I have Pageforms query form That I have been using for some time. after upgrade, The query works, however the links are bad know.
I get: server.comClient_Firewall/TS-2DRoadmap it should be: server.com/wiki/Client_Firewall/TS-Roadmap
{{#ifeq: {{{cat|}}} | Technology | {{#sparql: PREFIX property:<server.comProperty-3A> PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?Name ?Owner ?Publication_Status ?Start_Date ?End_Date ?Status ?Link WHERE { ?Link property:Has_parent_page ?parent. ?parent property:PublicationStatus ?Publication_Status . ?Link property:Has_subobject ?Subobject . ?Subobject property:Technology_Name ?Name . ?Subobject property:Has_Start_Date ?Start_Date . OPTIONAL { ?Subobject property:Has_End_Date ?End_Date . } ?Subobject property:Has_Support_Status ?Status . OPTIONAL { ?parent ?p ?sub . ?cat rdfs:label ?Category . FILTER(CONTAINS(STR(?cat), "Category")) . ?sub rdfs:subClassOf ?cat . ?sub rdfs:label ?Subcategory . } {{#ifeq: {{{subcategory|}}} | all | | FILTER regex(?Subcategory, "{{{subcategory|}}}", "i") . }} {{#if:{{{tech|}}} | FILTER regex(?Name, "{{{tech|}}}", "i") . }} {{#if:{{{tech_owner|}}} | ?Link property:OwnedBy ?Owner . FILTER regex(?Owner, "{{{tech_owner|}}}", "i") . | OPTIONAL { ?Link property:OwnedBy ?Owner . } }} {{#if: {{{tech_contact|}}} | ?Link property:Contact ?Contact . FILTER regex(?Contact, "{{{tech_contact|}}}", "i") . | }} {{#if: {{{manufactured|}}} | ?parent property:ManufacturedBy ?Manufacturer . FILTER regex(?Manufacturer, "{{{manufactured|}}}", "i") . | }} {{#ifeq: {{{status|}}} | all | | FILTER regex(?Status, "{{{status|}}}", "i") . }} {{#ifeq: {{{support|}}} | all | | ?Subobject property:Supported_By ?Support . FILTER regex(?Support, "{{{support|}}}", "i") . }} } ORDER BY ?Name ?End_Date LIMIT 100000 |endpoint=http://serverendpoint.com/sparql}} | }}
Legaulph (talk) 12:14, 18 March 2020 (UTC)
- Hi,
- Can you reproduce the bug in this form ?
- https://linkedwiki.com/queryInsertUpdate.php Karima Rafes (talk) 12:30, 18 March 2020 (UTC)
- It's on a private network.
- Legaulph (talk) 12:37, 18 March 2020 (UTC)
- You can also try to reproduce it in the form of your SPARQL service. Karima Rafes (talk) 12:39, 18 March 2020 (UTC)
- I'm not sure what you mean. I'm not that fluent in SPARQL. Legaulph (talk) 13:20, 18 March 2020 (UTC)
- The data is not modified by the extension. You must verify that the data is correct in your database.
- select distinct ?link where { ?link property:Has_subobject ?Subobject . } Karima Rafes (talk) 13:25, 18 March 2020 (UTC)
- I'm using short urls. The SPARQL Query at my endpoint are not adding /wiki/ and leaving out the / before the page name. However when I run the ask query it does bring back the correct link.
- I don't know what that means and maybe I should post the question on SMW site?
- Legaulph (talk) 14:50, 18 March 2020 (UTC)
- If SMW saves your wiki, it's probably a problem with the SMW's configuration. Karima Rafes (talk) 14:54, 18 March 2020 (UTC)
- I check LinkedWiki configuration and this error shows:
[514eb7f4c34734ca0fec92cf] /wiki/Special:LinkedWikiConfig Error from line 29 of D:\xampp\htdocs\mediawiki\extensions\LinkedWiki\specialpages\SpecialLinkedWikiConfig.php: Call to undefined method OutputPage::addWikiTextAsInterface()
Backtrace:
#0 D:\xampp\htdocs\mediawiki\includes\specialpage\SpecialPage.php(565): SpecialLinkedWikiConfig->execute(NULL)
#1 D:\xampp\htdocs\mediawiki\includes\specialpage\SpecialPageFactory.php(568): SpecialPage->run(NULL)
#2 D:\xampp\htdocs\mediawiki\includes\MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#3 D:\xampp\htdocs\mediawiki\includes\MediaWiki.php(861): MediaWiki->performRequest()
#4 D:\xampp\htdocs\mediawiki\includes\MediaWiki.php(524): MediaWiki->main()
#5 D:\xampp\htdocs\mediawiki\index.php(42): MediaWiki->run()
#6 {main}
Legaulph (talk) 12:55, 20 March 2020 (UTC)
- Can you compare your old settings with the new template extension.json ?
- https://github.com/wikimedia/mediawiki-extensions-LinkedWiki/blob/master/extension.json Karima Rafes (talk) 14:19, 20 March 2020 (UTC)
- MediaWiki 1.31.1
PHP 7.1.30 (apache2handler)
MySQL 5.6.10
Semantic MediaWiki 2.5.8
CirrusSearch 0.2 (ad9a0d9) 16:24, 17 April 2018
Elastica 1.3.0.0 (7019d96) 20:49, 13 April 2018
- This configuration was very different
- This was in the old configuration and it had fuseki instead of virtuoso. I added it below the example. still get the same error
"http://server.com": {
"isReadOnly": true,
"typeRDFDatabase": "virtuoso",
"endpoint": "http://server.com/sparql",
"HTTPMethodForRead": "GET"
}
Legaulph (talk) 16:31, 20 March 2020 (UTC)- Is it blocking?
- Otherwise the other features work? Karima Rafes (talk) 16:45, 20 March 2020 (UTC)
- For virtuoso, try only :
- "http://server.com": {
- "isReadOnly": true,
- "endpointRead": "http://server.com/sparql",
- } Karima Rafes (talk) 17:13, 20 March 2020 (UTC)
- I see the error : it's now endpointRead and not only endpoint. Karima Rafes (talk) 17:14, 20 March 2020 (UTC)
- Other features work, and the queries work other than the links are bad. Still get the error on the LinkedWiki configuration page.
SPARQL Flint editor gives the error: Classes cannot be retrieved. HTTP Status: 0,
SPARQL Editor seems fine
Legaulph (talk) 10:45, 21 March 2020 (UTC)- Ok thanks.
- I think :
- - for the bad links, you need to check saved IRIs in your database (open the page http://server.com/sparql and test the SPARQL query "select distinct ?link where { ?link property:Has_subobject ?Subobject . }"). If your IRIs are false in your database, you have to change your settings of Mediawiki and/or SMW to generate the good links (and save/clean your database before each test).
- - for Fint editor, you need to precise your endpoint manually (it's a old editor)
- - for the LinkedWiki configuration page, it's a problem of version. You need to install Mediawiki 1.33.1+. The function addWikiTextAsInterface not exists before 1.32. Karima Rafes (talk) 11:18, 21 March 2020 (UTC)
- OK I needed to update enableSemantics( 'example.org/wiki/', true ); fixed most of the issues. why id the link "-" changed to "-2D"
exampl.org/wiki/Client_Firewall/TS-2DRoadmap the actual link shows like this now. https://exampl.org/wiki/Special:RunQuery/exampl.org/wiki/Client_Firewall/TS-2DRoadmap
I will check with Page Forms extension to see if they have suggestions.
- Well I was running into a lot of issue trying to move to MediaWiki 1.34. I needed to move to a supported Semantic MediaWiki first before resolving those issues.
- Thanks for your help! Legaulph (talk) 12:56, 21 March 2020 (UTC)
- Sorry Karima the question I have for you, even though it was the same in the old version.
- Why do the links with a "-" changed to "-2D"? Legaulph (talk) 11:36, 23 March 2020 (UTC)
- Give me a sample of triples and the code of the wiki page with this problem. I will try to reproduce/fix this problem at the next update. Karima Rafes (talk) 12:32, 23 March 2020 (UTC)
- when I run this on a wiki page I get the result with the -2D on the link column, I do see it is fine on other columns where there is a link
{{#sparql:
PREFIX property:<https://server.com/wiki/Property-3A>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#>
SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?Link
WHERE
{
?Link property:Has_parent_page ?parent.
?parent property:PublicationStatus ?Publication_Status .
?Link property:Has_subobject ?Subobject .
?Subobject property:Technology_Name ?Name .
?Subobject property:Has_Start_Date ?Start_Date .
OPTIONAL {
?Subobject property:Has_End_Date ?End_Date .
}
?Subobject property:Has_Support_Status ?Status .
OPTIONAL {
?parent ?p ?sub .
?cat rdfs:label ?Category .
FILTER(CONTAINS(STR(?cat), "Category")) .
?sub rdfs:subClassOf ?cat .
?sub rdfs:label ?Subcategory .
}
?subobject property:Has_Version ?version .
?subobject property:Technology_Name ?technology_name .
?subobject property:Has_Support_Status ?support_status .
?subobject property:Supported_By ?supported_by .
?subobject property:Has_Start_Date ?start_date .
OPTIONAL {
?subobject property:Has_End_Date ?end_date .
}
OPTIONAL {
?parent property:OwnedBy ?owner.
}
OPTIONAL {
?parent property:PublicationDate ?publication_date .
?parent property:PublicationStatus ?publication_status .
}
OPTIONAL {
?parent ?p ?sub .
?cat rdfs:label ?Category .
FILTER(CONTAINS(STR(?cat), "Category")) .
?sub rdfs:subClassOf ?cat .
?sub rdfs:label ?Subcategory .
}
OPTIONAL {
?parent property:ManufacturedBy ?manufacturer.
}
OPTIONAL {
?parent property:Contact ?contact.
}
}
LIMIT 10
|endpoint=http://server.com/sparql}}
Legaulph (talk) 14:17, 23 March 2020 (UTC)- And the sample of triples directly of your database ? Karima Rafes (talk) 14:25, 23 March 2020 (UTC)
- You can use this special page to export the RDF:
- https://www.semantic-mediawiki.org/wiki/Special:ExportRDF/SMWCon_Fall_2015
- Doc: https://www.semantic-mediawiki.org/wiki/Help:RDF_export Karima Rafes (talk) 14:37, 23 March 2020 (UTC)
- The same from the endpoint
supported_by Subcategory name version technology_name owner contact publication_date publication_status support_status Link
"TS-Roadmap"
"Technology Roadmap"
"ENTERPRISE 47X110"
"SAP R/3 ENTERPRISE 47X110"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Full"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
"TS-Roadmap"
"Technology Roadmap"
"4.6C"
"SAP R/3 4.6C"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Limited"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
"TS-Roadmap"
"Technology Roadmap"
"4.0B"
"SAP R/3 4.0B"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Limited"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
"TS-Roadmap"
"Technology Roadmap"
"4.5B"
"SAP R/3 4.5B"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Limited"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
"TS-Roadmap"
"Technology Roadmap"
"4.0B"
"SAP R/3 4.0B"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Full"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
"TS-Roadmap"
"Technology Roadmap"
"4.5B"
"SAP R/3 4.5B"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Full"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
"TS-Roadmap"
"Technology Roadmap"
"4.6C"
"SAP R/3 4.6C"
""
"DBServices@its.jnj.com"
2014-03-14Z
"Released"
"Full"
https://server.com/wiki/SQL_Server/TS-2DRoadmap
Legaulph (talk) 14:38, 23 March 2020 (UTC)- Show me the result of this link : https://server.com/wiki/Special:ExportRDF/SQL_Server/TS-Roadmap Karima Rafes (talk) 14:41, 23 March 2020 (UTC)
- I found. SMW transforms the links of wiki. You have to insert a rewrite rule in your HTTP server :
- Doc : https://www.semantic-mediawiki.org/wiki/Help:Pretty_URIs Karima Rafes (talk) 14:52, 23 March 2020 (UTC)
- Karima, Thank you, much appreciated. Legaulph (talk) 15:06, 23 March 2020 (UTC)
- You're welcome. Bye. Karima Rafes (talk) 15:20, 23 March 2020 (UTC)
Fail to insert to SPARQL endpoint
editHello,
I am quite new to LinkedWiki, but have been playing with it in localhost MW instance, along with Fuseki. It is really interesting combination. Ultimately I would like to "mirror" all the semantic property:value pairs on to a Fuseki dataset, but at the moment I am struggling to do inserts from MW to the Fuseki SPARQL endpoint. an I wondering if I could get some help here :)
I am running:
- MediaWiki 1.34.1
- PHP 7.3.14-1~deb10u1 (apache2handler)
- MariaDB 10.3.22-MariaDB-0+deb10u1
- Semantic MediaWiki3.1.6
In the Special:SparqlQuery I can perform SELECT queries no problem.
However, when I try to perform the following insert, I get Error message: Sorry, you have not configure the endpoint to update the database.
Which is strange since the same statement run just fine in the SPARQL Flint editor
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
DELETE
{ foaf:Person foaf:name "Sara" . }
INSERT
{ foaf:Person foaf:name "Zara" . }
WHERE { foaf:Person foaf:name "Sara" . }
Or with a POST request via curl
curl http://localhost:3030/beerwiki/ -X POST --data 'update=%0APREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0A%0ADELETE%0A%7B%0A++++foaf%3APerson+foaf%3Aname+%22Sara%22+.+%0A%7D%0AINSERT%0A%7B%0A%09foaf%3APerson+foaf%3Aname+%22Zara%22+.+++%0A%7D%0AWHERE+%7B%0A%09foaf%3APerson+foaf%3Aname+%22Sara%22+.+++%0A%7D' -H 'Accept: text/plain,*/*;q=0.9'
Here is my InterWiki setting in LocalSettings.php
wfLoadExtension( 'LinkedWiki' );
$wgAutoloadClasses['BeerwikiStorageMethod'] = "$IP/extensions/LinkedWiki/storageMethod/BeerwikiStorageMethod.php";
$wgLinkedWikiConfigSPARQLServices["http://localhost/beerwiki"] = array(
"debug" => true,
"isReadOnly" => false,
"typeRDFDatabase" => "fuseki",
"endpointRead" => "http://localhost:3030/beerwiki/",
"endpointWrite" => "http://localhost:3030/beerwiki/",
"login" => "admin",
"password" => "pw123",
"HTTPMethodForRead" => "POST",
"HTTPMethodForWrite" => "POST",
"lang" => "en",
"nameParameterRead" => "query",
"nameParameterWrite" => "update",
"storageMethodClass" => "BeerwikiStorageMethod"
);
$wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost:3030/beerwiki/";
And the BeerwikiStorageMethod.php
<?php
class BeerwikiStorageMethod extends StorageMethodAbstract {
/**
* @return string
*/
private $graphNamed = "http://localhost/beerwiki";
public function getQueryReadStringWithTagLang() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
FILTER ( lang(?value) = ?lang )
}
EOT;
}
/**
* @return string
*/
public function getQueryReadStringWithoutTagLang() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
FILTER ( lang(?value) = "" )
}
EOT;
}
/**
* @return string
*/
public function getQueryReadValue() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
}
EOT;
}
/**
* @return string
*/
public function getQueryInsertValue() {
return <<<EOT
INSERT DATA
{
?subject ?property ?value .
}
EOT;
}
/**
* @return string
*/
public function getQueryDeleteSubject() {
return <<<EOT
DELETE
{ ?subject ?property ?value . }
WHERE
{ ?subject ?property ?value . }
EOT;
}
/**
* @param string $url
* @return string
*/
public function getQueryLoadData( $url ) {
return "";
}
}
ACastro24 (talk) 14:31, 16 May 2020 (UTC)
- Hello,
- You need to change :
- $wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost:3030/beerwiki/";
- by the same key in $wgLinkedWikiConfigSPARQLServices :
- $wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost/beerwiki";
- The wiki doesn't find the config "http://localhost:3030/beerwiki/" and then it uses the config by default where the update endpoint does not exist. Karima Rafes (talk) 15:21, 16 May 2020 (UTC)
- Thank you Karima, That makes sense. I changed it, but I am still getting the same error message.
- Here is the section of LocalSettings.php concerning LinkedWiki, as it stands:
wfLoadExtension( 'LinkedWiki' ); $wgAutoloadClasses['BeerwikiStorageMethod'] = "$IP/extensions/LinkedWiki/storageMethod/BeerwikiStorageMethod.php"; $wgLinkedWikiConfigSPARQLServices["http://localhost/beerwiki"] = array( "debug" => true, "isReadOnly" => false, "typeRDFDatabase" => "fuseki", "endpointRead" => "http://localhost:3030/beerwiki/", "endpointWrite" => "http://localhost:3030/beerwiki/", "login" => "admin", "password" => "pw123", "HTTPMethodForRead" => "POST", "HTTPMethodForWrite" => "POST", "lang" => "en", "nameParameterRead" => "query", "nameParameterWrite" => "update", "storageMethodClass" => "BeerwikiStorageMethod" ); $wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost/beerwiki";
ACastro24 (talk) 09:43, 18 May 2020 (UTC)- In the special page about the LinkedWiki configuration, all is ok ?
- In the http errors, there is nothing ? Karima Rafes (talk) 10:25, 18 May 2020 (UTC)
- Try also without the parameter : "typeRDFDatabase" => "fuseki" Karima Rafes (talk) 10:37, 18 May 2020 (UTC)
- Thank you Karima.
- commenting <code>"typeRDFDatabase" => "fuseki"</code> did not change anything
- The special page about the LinkedWiki configuration seems OK. Here is a screen capture of the config for that endpoint.
- http://artserver.org/publicfiles/Screenshot_2020-05-18%20LinkedWiki%20configuration%20-%20beerwiki.png
- This is the error I get:
- Error endpoint:
- Error http_response_code: 0
- Error message: Sorry, you have not configure the endpoint to update the database.
- It does not seem to get any response from the SPARQL endpoint.
- In Fuseki call the update POST also does not get acknowledged, which makes me think that the issue might be in how LinkedWiki is trying to "talk" to fuseki on update posts.
- Is there a way I can debugg the POST calls that LinkedWiki is making to the SPARQL endpoint?
ACastro24 (talk) 19:36, 18 May 2020 (UTC)- The problem is probably in the config of Fuseki or in the SPARQL client.
- Try to test directly via this project :
- https://github.com/BorderCloud/SPARQL
- You can create a new test for Fuseki such as "https://github.com/BorderCloud/SPARQL/blob/master/tests/virtuosoTest.php"
- After you can change the line 36 in "src/Curl.php" by $debug = true, you will see the protocol between Fuseki and the client. Karima Rafes (talk) 06:27, 19 May 2020 (UTC)
- I pushed a new version. There are a bug in the special page RDFUnit and refresh database for the version 1.34.1.
- I don't know if your problem is related.
- NB: You need to change a little your localsettings (new installation about PushAll and of NamespaceData) Karima Rafes (talk) 12:03, 14 June 2020 (UTC)
Internal Error trying to delete a page
editMediaWiki 1.31.7
PHP 7.3.19 (apache2handler) MySQL 8.0.20 Elasticsearch 5.6.16 Semantic MediaWiki 3.1.6 LinkedWiki 3.4.0 (5601693) 07:10, 14 June 2020
[a0f68dd572e6f78708d8afea] /index.php?title=Encrypting_Databases_test&action=delete Error from line 84 of D:\Bitnami\wampstack\apps\mediawiki\extensions\LinkedWiki\LinkedWiki.php: Call to undefined method OutputPage::addWikiTextAsInterface() Backtrace:
- 0 D:\Bitnami\wampstack\apps\mediawiki\includes\Hooks.php(177): LinkedWiki::onArticleDeleteAfterSuccess(Title, OutputPage)
- 1 D:\Bitnami\wampstack\apps\mediawiki\includes\Hooks.php(205): Hooks::callHook(string, array, array, NULL)
- 2 D:\Bitnami\wampstack\apps\mediawiki\includes\page\Article.php(1871): Hooks::run(string, array)
- 3 D:\Bitnami\wampstack\apps\mediawiki\includes\page\Article.php(1618): Article->doDelete(string, boolean)
- 4 D:\Bitnami\wampstack\apps\mediawiki\includes\actions\DeleteAction.php(46): Article->delete()
- 5 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(500): DeleteAction->show()
- 6 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(294): MediaWiki->performAction(Article, Title)
- 7 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(861): MediaWiki->performRequest()
- 8 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(524): MediaWiki->main()
- 9 D:\Bitnami\wampstack\apps\mediawiki\index.php(42): MediaWiki->run()
- 10 {main}
Legaulph (talk) 16:26, 23 July 2020 (UTC)
- You have to update your mediawiki.
- OutputPage::addWikiTextAsInterface() exists since 1.32. Karima Rafes (talk) 16:53, 23 July 2020 (UTC)
popper.js not found after MW 1.35 upgrade
editRESOLVED | |
By mistake didn't installed it with the composer/yarn |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
The following error occured after upgrade to MW 1.35 (Linked 3.4.2), it seems popper.js is missing.
/linked/load.php?lang=en&modules=ext.LinkedWiki.SparqlParser%2Csgvizler2%7Cjquery%2Coojs-ui-core&skin=vector&version=1wkye RuntimeException from line 485 of /var/www/html/includes/resourceloader/ResourceLoaderFileModule.php: ResourceLoaderFileModule::getFileContents: script file not found, or is not a file: "/var/www/html/extensions/LinkedWiki/node_modules/popper.js/dist/umd/popper.min.js"
Backtrace:
#0 /var/www/html/includes/resourceloader/ResourceLoaderFileModule.php(905): ResourceLoaderFileModule->getFileContents(string, string)
#1 /var/www/html/includes/resourceloader/ResourceLoaderFileModule.php(362): ResourceLoaderFileModule->readScriptFiles(array)
#2 /var/www/html/includes/resourceloader/ResourceLoaderModule.php(736): ResourceLoaderFileModule->getScript(ResourceLoaderContext)
#3 /var/www/html/includes/resourceloader/ResourceLoaderModule.php(704): ResourceLoaderModule->buildContent(ResourceLoaderContext)
#4 /var/www/html/includes/resourceloader/ResourceLoader.php(1191): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)
#5 /var/www/html/includes/resourceloader/ResourceLoader.php(899): ResourceLoader->makeModuleResponse(ResourceLoaderContext, array, array)
#6 /var/www/html/load.php(51): ResourceLoader->respond(ResourceLoaderContext)
#7 /var/www/html/load.php(38): wfLoadMain()
#8 {main}
S0ring (talk) 15:01, 2 October 2020 (UTC)
How to install sgvizler2 in MediaWiki
editRESOLVED | |
Documentation : Extension:LinkedWiki#Installation_of_LinkedWiki |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
After install the LinkedWiki extnesion, how we can install sgvizler2 ? Lotusccong (talk) 14:47, 22 June 2021 (UTC)
- If you have done all steps here : Extension:LinkedWiki#Installation of LinkedWiki. sgvizler2 has been installed via the command yarn. You can now use it. Karima Rafes (talk) 14:56, 22 June 2021 (UTC)
Show blank page in SPARQL results if have | chart=bordercloud.visualization.DataTable
editRESOLVED | |
Probably an error in the query ... Add |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
As a new beginner in LinkedWiki, I copy the SPARQL Wiki sytax from Linkedwiki.com
It seems that if I included the | chart=bordercloud.visualization.DataTable , it will show blank page.
After I remove it, it did show the results.
Appreciate you can enlight me why this happen ? Lotusccong (talk) 15:06, 22 June 2021 (UTC)
- Probably an error in the query or in the configuration...
- Add | log=2
- And | debug=YES
- Details : https://www.mediawiki.org/wiki/Extension:LinkedWiki/Sparql_parser#Parameter:_log Karima Rafes (talk) 15:21, 22 June 2021 (UTC)
- Can you share the link of the query in Linkedwiki.com ? I will check in my wiki. Karima Rafes (talk) 15:40, 22 June 2021 (UTC)
- My Link page is at http://tbpedia.org/book/index.php/DemoLinkeddata . I set the return results LIMIT to 5 .
- You will notice that the query that included with | chart=bordercloud.visualization.DataTable show no error , no results.
- Without , able to show the results.
- I get the query from https://linkedwiki.com/query/Wikipedia_research Lotusccong (talk) 10:14, 23 June 2021 (UTC)
- File not found : "/home/sjkcyuhu/public_html/tbpedia.org/book/extensions/LinkedWiki/node_modules/popper.js/dist/umd/popper.min.js"
- Does the directory "extensions/LinkedWiki/node_modules" exist ?
- If no, you need to go in this the extension folder : cd extensions/LinkedWiki
- and execute : yarn install --production=true (or npm install --production) Karima Rafes (talk) 12:13, 23 June 2021 (UTC)
- Got it. I notice that I didn't run the yarn install or npm install after I run the Composer installation. That's why the intallation is incomplete but it show as installed in Special page. my hosting Terminal not support runnning yarn or npm comman but support composer.
- Any better way that make the installtion process only required the Composer ? Lotusccong (talk) 13:51, 23 June 2021 (UTC)
- When an extension uses a javascript library not avalaible in Mediawiki, there is no other solution than to install it manually.
- I have to check if Mediawiki 3.6 can now automate the installation of extension libraries with yarn or npm. Karima Rafes (talk) 14:16, 23 June 2021 (UTC)
Querying multiple sources
editIs it possible to query multiple endpoints at once (for example, Wikidata, Europeana and our own pages) and then represent the returned properties in a map or data table, as it is possible to do with a single endpoint? I wanted to be able to show common properties between these endpoints and each of their entries. Jdm.oliveira (talk) 15:09, 25 November 2022 (UTC)
- In theory yes... LinkedWiki sends the federated query at one endpoint to execute the the query. After this endpoint communicates with other endpoints to resolve the query.
- Generally, before, you need to enable "federated query processing" in the database (example with Virtuoso). Karima Rafes (talk) 15:56, 25 November 2022 (UTC)
- Thank you for your answer. Sadly my database is not with Virtuoso but with MySQL. I have not found out yet a way that lets me enable federated query processing without isql.
- If I try to do a federated query (simply using "
SERVICE<http://sparql.europeana.eu/>{}
" I also get the following error: - "Sorry, the sparql server sent an error.
- Virtuoso 42000 Error SQ070:SECURITY: Must have select privileges on view DB.DBA.SPARQL_SINV_2 SPARQL query"
- I am still quite unexperienced with SPARQL, but my idea was to query properties from both endpoints, such as coordinates, and place them on a leaflet map. I can do this only with one endpoint so far. Jdm.oliveira (talk) 17:04, 26 November 2022 (UTC)
composer installation not compatible with node.js 18
editThe following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
The composer installation fails with the following errors
# composer install --no-dev
...
1.169 [1/4] Resolving packages...
2.133 warning popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
11.49 [2/4] Fetching packages...
23.38 error eslint-plugin-jsdoc@39.2.2: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || ^17". Got "18.17.1"
23.40 error Found incompatible module.
134.34.200.62 (talk) 08:27, 21 August 2023 (UTC)
- See response here:
- https://phabricator.wikimedia.org/T334662 Karima Rafes (talk) 19:01, 5 September 2023 (UTC)
npm install --production=true
instead ofyarn install --production=true
fixed the error 134.34.200.62 (talk) 10:59, 11 September 2023 (UTC)- I updated the packages in the last version. (master) Karima Rafes (talk) 21:18, 15 October 2023 (UTC)
Fail to insert to SPARQL endpoint
editHello!
I am struggling to do insert from Mediawiki 1.39.5 to GraphDB SPARQL endpoint. I have installed the LinkedWiki 3.7.1 compatible with MW. Also, i am running SMW 4.1.1, PHP 8.1.2 and MySQL 8.0.35
In the Special:SparqlQuery I can perform SELECT queries no problem.
However, when I try to perform the following insert, I get Error message: Sorry, you have not configure the endpoint to update the database.
Which is strange since the same statement run just fine in the GraphDB sparql endpoint
PREFIX dc: <http://purl.org/dc/elements/1.1/>
INSERT {
GRAPH <http://example> {
<http://example/book2> dc:title "A new book2" ;
dc:creator "A.N.Other2" .
}
Here is my setting in LocalSettings.php
wfLoadExtension( 'LinkedWiki' );
$wgAutoloadClasses['GraphdbStorageMethod'] = "$IP/extensions/LinkedWiki/storageMethod/GraphdbStorageMethod.php";
$wgLinkedWikiConfigSPARQLServices["http://localhost/graphdb"] = array(
"debug" => true,
"isReadOnly" => false,
"typeRDFDatabase" => "graphdb",
"endpointRead" => "http://localhost:3030/graphdb/myrepository",
"endpointWrite" => "http://localhost:3030/graphdb",
"login" => "test",
"password" => "test",
"HTTPMethodForRead" => "POST",
"HTTPMethodForWrite" => "POST",
"lang" => "en",
"nameParameterRead" => "query",
"nameParameterWrite" => "update",
"storageMethodClass" => "GraphdbStorageMethod"
);
$wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost:3030/graphdb";
And the GraphdbStorageMethod.php
<?php
class GraphdbStorageMethod extends StorageMethodAbstract {
/**
* @return string
*/
private $graphNamed = "http://localhost/graphdb";
public function getQueryReadStringWithTagLang() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
FILTER ( lang(?value) = ?lang )
}
EOT;
}
/**
* @return string
*/
public function getQueryReadStringWithoutTagLang() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
FILTER ( lang(?value) = "" )
}
EOT;
}
/**
* @return string
*/
public function getQueryReadValue() {
return <<<EOT
SELECT DISTINCT ?value
WHERE
{
?subject ?property ?value .
}
EOT;
}
/**
* @return string
*/
public function getQueryInsertValue() {
return <<<EOT
INSERT DATA
{
?subject ?property ?value .
}
EOT;
}
/**
* @return string
*/
public function getQueryDeleteSubject() {
return <<<EOT
DELETE
{ ?subject ?property ?value . }
WHERE
{ ?subject ?property ?value . }
EOT;
}
/**
* @param string $url
* @return string
*/
public function getQueryLoadData( $url ) {
return "";
}
}
193.170.253.73 (talk) 09:32, 13 December 2023 (UTC)
- I also noticed this while using {{#sparql ..}} in a page and used the same query that it sent wrong "POST" request to the SPARQL server. Instead of .../sparql?update=... it is sending .../sparql?query=... 193.170.253.73 (talk) 15:12, 13 December 2023 (UTC)
- I see an error with the variable "save", try this line:
- $wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost/graphdb";
- {{#sparql is always with Query parameter (reading only). To save data, you need to use the RDF elements in a page
- https://www.mediawiki.org/wiki/Extension:LinkedWiki#Write_data_of_main_pages_in_a_data_namespace
- or via Lua:
- https://www.mediawiki.org/wiki/Extension:LinkedWiki/lua
- Best,
- Karima Karima Rafes (talk) 15:58, 13 December 2023 (UTC)
- Thank you for the quick response and the information. I have changed the variable but i am still getting the same error. 193.170.253.73 (talk) 07:40, 18 December 2023 (UTC)
- I didn't test with GraphDB but I think, it's a problem in the configuration.
- You can use the special page LinkedWiki to check each parameter in your configuration. Karima Rafes (talk) 09:08, 18 December 2023 (UTC)
- Special page LinkedWiki has the same parameters, which i defined in my LocalSettings.php.
- $wgLinkedWikiConfigSPARQLServices["http://localhost/graphdb"] = array(
- "debug" => true,
- "isReadOnly" => false,
- "typeRDFDatabase" => "graphdb",
- "endpointRead" => "http://localhost/graphdb/myrepository",
- "endpointWrite" => "http://localhost/graphdb/myrepository/statements",
- "login" => "test",
- "password" => "test",
- "HTTPMethodForRead" => "POST",
- "HTTPMethodForWrite" => "POST",
- "lang" => "en",
- "nameParameterRead" => "query",
- "nameParameterWrite" => "update",
"storageMethodClass" => "GraphdbStorageMethod"
- );
- $wgLinkedWikiSPARQLServiceSaveDataOfWiki= "http://localhost/graphdb";
- I don't know what is the exact issue. 193.170.253.73 (talk) 09:56, 18 December 2023 (UTC)
- Try, debug= false Karima Rafes (talk) 10:12, 18 December 2023 (UTC)
- What is your version of PHP?
- 7 is only supported for the moment (php8 is not supported by MediaWiki officially)
- If there is always a problem with php7:
- OPTION A: if you pay a license GraphDB, you can probably ask the help of GraphDB support to open the PHP code.
- OPTION B: switch on another database
- OPTION C: debug the PHP code yourself and send me the fix ;) Karima Rafes (talk) 10:29, 18 December 2023 (UTC)
- I am using php 8 and I am using free version of GraphDB. If php version is causing the problem then i will try with php7 and then update you about the issue. 193.170.253.73 (talk) 14:20, 18 December 2023 (UTC)
Datatable security error with sgvizler2
editHello,
Am getting et secutirty issue for sgvizler and i think it's caused by datatables version as on this discussion for SMW.
Can you consider migrate to datatable 1.10.23, or 2.0.3, published on 22 Mar, 2024 see discussion on version safe?
Regards! Willyedoo (talk) 12:58, 19 June 2024 (UTC)
- Thanks.
- I create the ticket:
- https://phabricator.wikimedia.org/T375155
- In the meantime, you can perform the operation manually in the folder lib of datables (backup the folder to do a rollback if the new version is not supported).
- Best regards. Karima Rafes (talk) 07:05, 19 September 2024 (UTC)
Column Sorting in SGVizler2 Tables
editHi, I’m trying to enable sorting on all columns in SGVizler2 tables (with small arrows for ascending/descending order). Even with the ordering
option set in DataTables (in commons.js), the columns are still showing as sorting_disabled
. I’d like to be able to sort any column, not just the first one. Has anyone else run into this or know how to fix it?
Thanks for any help! Anchardo (talk) 07:04, 17 September 2024 (UTC)
- Can you reproduce this problem on Linkedwiki.com with the Wikidata endpoint? And share the link here.
- Thanks. Karima Rafes (talk) 08:18, 17 September 2024 (UTC)
- Here is an example: https://linkedwiki.com/query/Swiss_writers
- I don't know which/if an option can be used to enable the ordering (cf. https://datatables.net/reference/option/ordering)...? Anchardo (talk) 09:51, 17 September 2024 (UTC)
- Hello,
- I audited the code. So, the response is on this page:
- https://datatables.net/reference/option/columnDefs
- Without parameters with the option "targets", the columnDef disables the targets.
- (line 109 of file DataTable.ts disables the targets)
- In the javascript of sgvizler, try to find the code: "'targets': c," and remove it. I think, it can fix quickly this problem. There will also be side effects on appearance (maybe?).
- Sparql controls the order in the columns. It's probably why I disabled this option.
- I will add the possibility to control the targets in the next version but I dont know when... I created the ticket.
- https://phabricator.wikimedia.org/T375154 Karima Rafes (talk) 06:41, 19 September 2024 (UTC)
- Thanks for your investigation!
- I tried to comment the line '"'targets':c" in the sgvizler2.js file (+ add an option), but without visible change on my table. Since I am in a tight schedule I decided to simplify my tables (cf. also my other question of the PDFs - where not all the columns were visible) and to provide the ordering via SPARQL.
- What could be useful in the future would be to document if it is possible to "overwrite" the current code via common.js or how to proceed to change this kind of thing. Anchardo (talk) 14:00, 19 September 2024 (UTC)
SGVizler 2 tables in PDF format
editHello,
Currently, when generating a PDF with SGVizler 2 tables, the content sometimes exceeds the width of an A4 page in portrait format, causing columns to be cut off. Is there a way to set the PDF to landscape format, or any other solution to ensure all columns are included?
Best regards Anchardo (talk) 07:20, 17 September 2024 (UTC)
- Sgvizler2 uses the tool datatables to generate the table and the pdf button. There is probably one option in datatables to resolve your problem. If you find it, you can try to push this parameter in the options of sgvizler2. Karima Rafes (talk) 08:11, 17 September 2024 (UTC)