Topic on Extension talk:LinkedWiki

Query page using linked wiki

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

Reply to "Query page using linked wiki"