Extension talk:LinkedWiki

Jump to navigation Jump to search

About this board

popper.js not found after MW 1.35 upgrade

1
Summary by S0ring

By mistake didn't installed it with the composer/yarn

S0ring (talkcontribs)

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}

Internal Error trying to delete a page

2
Legaulph (talkcontribs)
MediaWiki	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:

  1. 0 D:\Bitnami\wampstack\apps\mediawiki\includes\Hooks.php(177): LinkedWiki::onArticleDeleteAfterSuccess(Title, OutputPage)
  2. 1 D:\Bitnami\wampstack\apps\mediawiki\includes\Hooks.php(205): Hooks::callHook(string, array, array, NULL)
  3. 2 D:\Bitnami\wampstack\apps\mediawiki\includes\page\Article.php(1871): Hooks::run(string, array)
  4. 3 D:\Bitnami\wampstack\apps\mediawiki\includes\page\Article.php(1618): Article->doDelete(string, boolean)
  5. 4 D:\Bitnami\wampstack\apps\mediawiki\includes\actions\DeleteAction.php(46): Article->delete()
  6. 5 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(500): DeleteAction->show()
  7. 6 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(294): MediaWiki->performAction(Article, Title)
  8. 7 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(861): MediaWiki->performRequest()
  9. 8 D:\Bitnami\wampstack\apps\mediawiki\includes\MediaWiki.php(524): MediaWiki->main()
  10. 9 D:\Bitnami\wampstack\apps\mediawiki\index.php(42): MediaWiki->run()
  11. 10 {main}

Legaulph (talk) 16:26, 23 July 2020 (UTC)

Karima Rafes (talkcontribs)
Reply to "Internal Error trying to delete a page"

Fail to insert to SPARQL endpoint

8
ACastro24 (talkcontribs)

Hello,

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 "";
    }

}
Karima Rafes (talkcontribs)
ACastro24 (talkcontribs)

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";


Karima Rafes (talkcontribs)

In the special page about the LinkedWiki configuration, all is ok ?

In the http errors, there is nothing ?

Karima Rafes (talkcontribs)

Try also without the parameter : "typeRDFDatabase" => "fuseki"

ACastro24 (talkcontribs)

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?


Karima Rafes (talkcontribs)
Karima Rafes (talkcontribs)

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)

Reply to "Fail to insert to SPARQL endpoint"
Legaulph (talkcontribs)
MediaWiki 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}}
 | }} 

Karima Rafes (talkcontribs)
Legaulph (talkcontribs)
It's on a private network.
Legaulph (talk) 12:37, 18 March 2020 (UTC)
Karima Rafes (talkcontribs)

You can also try to reproduce it in the form of your SPARQL service.

Legaulph (talkcontribs)
I'm not sure what you mean. I'm not that fluent in SPARQL.
Karima Rafes (talkcontribs)

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 . }

Legaulph (talkcontribs)
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)
Karima Rafes (talkcontribs)

If SMW saves your wiki, it's probably a problem with the SMW's configuration.

Legaulph (talkcontribs)
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)
Karima Rafes (talkcontribs)
Legaulph (talkcontribs)
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"
}
Karima Rafes (talkcontribs)

Is it blocking? Otherwise the other features work?

Karima Rafes (talkcontribs)
Karima Rafes (talkcontribs)

I see the error : it's now endpointRead and not only endpoint.

Legaulph (talkcontribs)

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
Karima Rafes (talkcontribs)

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.

Legaulph (talkcontribs)

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)
Karima Rafes (talkcontribs)

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.

Legaulph (talkcontribs)
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}}
Karima Rafes (talkcontribs)

And the sample of triples directly of your database ?

Karima Rafes (talkcontribs)
Legaulph (talkcontribs)
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
Karima Rafes (talkcontribs)
Karima Rafes (talkcontribs)
Legaulph (talkcontribs)

Karima, Thank you, much appreciated. Legaulph (talk) 15:06, 23 March 2020 (UTC)

Karima Rafes (talkcontribs)

You're welcome. Bye.

S0ring (talkcontribs)
Karima Rafes (talkcontribs)

No visualization for pictures available

6
Summary by Karima Rafes

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

S0ring (talkcontribs)

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?

Karima Rafes (talkcontribs)

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

S0ring (talkcontribs)

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

Karima Rafes (talkcontribs)

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;

S0ring (talkcontribs)
Karima Rafes (talkcontribs)

Thanks ! Bye ;)

Trying to upgrade to mediawiki 1.34.0

3
Summary by Legaulph

Update template in chef scripts

Legaulph (talkcontribs)
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 (talkcontribs)

OK I have installed MediaWiki 1.33.2 and ran update.php

I was able to install yarn and follow the install procedure.

Legaulph (talkcontribs)

I found the issue, has to do with chef scripts I use

SPARQL query inside Lua module

4
Tinker Bell (talkcontribs)

Hi. 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.

Karima Rafes (talkcontribs)

Hello

For the moment, it's not possible but it's simple to insert this new function.

For SPARQL select and update ?

Tinker Bell (talkcontribs)

I just want to make a query to Wikidata from my own wiki.

Karima Rafes (talkcontribs)

I will develop this feature at the next update (6-12 months) or you can send me the code.

Reply to "SPARQL query inside Lua module"

Fatal exception of type "MWException"

5
Legaulph (talkcontribs)
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"});

Karima Rafes (talkcontribs)

Have you insert your keys in the file keys.js ?

Legaulph (talkcontribs)

Can I disable the google maps sense I don't use it?

Karima Rafes (talkcontribs)

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 ?

Josephguillaume (talkcontribs)

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.

Reply to "Fatal exception of type "MWException""

Warnings when running 'yarn install --production=true'

4
Jukeboksi (talkcontribs)

Using

  • 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?

Karima Rafes (talkcontribs)

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.

Jukeboksi (talkcontribs)

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?

Karima Rafes (talkcontribs)

I didn't test with these version. (JQuery is already in Mediawiki) Say me if you see a bug.

Reply to "Warnings when running 'yarn install --production=true'"