Giter Site home page Giter Site logo

semanticmediawiki / semanticcite Goto Github PK

View Code? Open in Web Editor NEW
22.0 13.0 14.0 694 KB

Allows to manage citation resources using semantic annotations

Home Page: https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Cite

License: Other

PHP 93.50% CSS 2.86% JavaScript 2.51% Shell 1.14%
citation mediawiki mw smw semantic-mediawiki semantic sci

semanticcite's Introduction

Semantic MediaWiki

CI Latest Stable Version Packagist download count

Semantic MediaWiki (a.k.a. SMW) is a free, open-source extension to MediaWiki – the wiki software that powers Wikipedia – that lets you store and query data within the wiki's pages.

Semantic MediaWiki is also a full-fledged framework, in conjunction with many spinoff extensions, that can turn a wiki into a powerful and flexible knowledge management system. All data created within SMW can easily be published via the Semantic Web, allowing other systems to use this data seamlessly.

For a better understanding of how Semantic MediaWiki works, have a look at deployed in 5 min and the Sesame, Fuseki triplestore video, or browse the wiki for a more comprehensive introduction.

Requirements

Semantic MediaWiki requires MediaWiki and its dependencies, such as PHP.

Supported MediaWiki, PHP and database versions depend on the version of Semantic MediaWiki. See the compatibility matrix for details.

Installation

The recommended way to install Semantic MediaWiki is by using Composer. See the detailed installation guide as well as the information on compatibility.

Documentation

Most of the documentation can be found on the Semantic MediaWiki wiki. A small core of documentation also comes bundled with the software itself. This documentation is minimalistic and less explanatory than what can be found on the SMW wiki. It is however always kept up to date, and applies to the version of the code it comes bundled with. The most important files are linked below.

Support

Chatroom Twitter Facebook LinkedIn YouTube Mailing lists

Primary support channels:

Contributing

Many people have contributed to SMW. A list of people who have made contributions in the past can be found here or on the wiki for Semantic MediaWiki. The overview on how to contribute provides information on the different ways available to do so.

If you want to contribute work to the project please subscribe to the developers mailing list and have a look at the contribution guidelines.

Tests

This extension provides unit and integration tests and are normally run by a continuous integration platform but can also be executed locally using the shortcut command composer phpunit from the extension base directory. A more comprehensive introduction can be found under the test section.

License

GNU General Public License, version 2 or later. The COPYING file explains SMW's copyright and license.

semanticcite's People

Contributors

gesinn-it-gea avatar jaideraf avatar jeroendedauw avatar kghbln avatar kizule avatar krabina avatar mwjames avatar nikerabbit avatar siebrand avatar thomas-topway-it avatar translatewiki avatar zuzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

semanticcite's Issues

References header and references are sometimes detatched

Setup and configuration

  • MediaWiki 1.25.6 (01b4001) 21:49, 20 May 2016
  • PHP 5.6.11-1ubuntu3.4 (apache2handler)
  • MySQL 5.6.31-0ubuntu0.15.10.1
  • Semantic Cite 1.1.1 (a98b566) 18:33, 9 July 2016

Issue

Sometimes the References header and the references appear detached if another element causes a gap between the end of the text and the footer. See the screen shot from Help:Property usage count:

bildschirmfoto vom 2016-08-13 23 32 11

Lables for citation identifiers are no longer rendered

Setup and configuration

  • MediaWiki | 1.35.0-rc.2 (0f1a2a2)18:43, 21 August 2020
  • PHP | 7.2.24-0ubuntu0.18.04.6 (apache2handler)
  • MariaDB | 10.1.44-MariaDB-0ubuntu0.18.04.1
  • Semantic Cite | 2.1.1 (01dc68a) 12:04, 16 May 2020

Issue

Probably the same issue as #96 however on MW 1.35 the tooltips are loaded correctly. Moreover the parser functions are rendered. What is not working is rendering the labels for the citation identifiers.

Note: For some reason the upgrade to MW 1.35 caused all extensions to downgrade to the latest stable release rather than continuing to run @dev I suspect that if I downgraded on MW 1.34 I will see the same issue and not the one I reported with #96 which means that one of the commits on May 16, 2020 is likely to have caused this.

grafik

As seen here: https://sandbox.semantic-mediawiki.org/wiki/Gilbert%E2%80%99s_Dragon

PHP Fatal error: Access level to SCI\DataValues\ResourceIdentifierStringValue::getPreferredCaption() must be public

Setup and configuration

  • PHP 5.6.11-1ubuntu3.4 (apache2handler)
  • MySQL 5.6.30-0ubuntu0.15.10.1
  • MediaWiki 1.25.6 (01b4001) 21:49, 20 May 2016
  • Semantic MediaWiki 2.4.0 (61b7da6) 06:23, 9 July 2016
  • Semantic Cite 1.0.0 (68c619e) 22:03, 29 November 2015

Issue

When running "rebuildData.php" on smw.o the following fatal occurs twice:

PHP Fatal error:  Access level to SCI\DataValues\ResourceIdentifierStringValue::getPreferredCaption() must be public (as in class SMWDataValue) in /.../w/extensions/SemanticCite/src/DataValues/ResourceIdentifierStringValue.php on line 124

Affected page:

pages property

{{#scite:Byrne 2008
 |type=journal
 |author=Byrne, A
 |year=2008
 |title=Web 2.0 strategies in libraries and information services
 |journal=The Australian Library Journal
 |volume=57
 |number=4
 |pages=365-376
}}

is shown as an example. it will show up as ... 365-376 pages so that i assume pages is interpreted as the number of pages of a citation. What would the reference to a page range look like?

Pre-release extension testing

@SemanticMediaWiki/testers I'd like to invite people to test this extension before its release. It requires

How to install

Just run composer require mediawiki/semantic-cite:@dev + php maintenance/update.php

What to test

The general functionality of creating citation resources, display references (and lists), search citations, add individual text formatting and property assignments. See also:

grouping references

Setup and configuration

  • SMW version: 3.2.3
  • SCI version: 2.1.1
  • MW version: 1.35.5
  • DB (MySQL etc. and version): 10.2.43-MariaDB

Question

Is it possible to group referencelists similar to "group" in the Cite-Extension? I would like, for instance, to create different lists for different types of references.

tooltip does not show up

Setup and configuration

  • SMW version:3.1.6
  • SCI version:2.1.0
  • MW version:1.31.1
  • DB (MySQL etc. and version):10.1.40-MariaDB

Issue

Hovering over cite-numbers only produces a loading symbol.

The browser console produces a stack trace and outputs:

VM3336:230 Uncaught TypeError: api.parse is not a function

The error seems to have been discussed at #70, but no solution has been presented.

Steps to reproduce the observation (recommendation is to use the sandbox):

https://www.univie.ac.at/rel_jap/an/Sandkiste2/SCI_example

Alternative for [[CiteRef:: ... ]]?

Since in the future its is possible that the syntax [[::]] will no longer work, is there an alternative for the same functionality?

Using {{#set: Citation reference= ...}} works to set the property to the page and the automatic rendering of the references section, but it does not format as an inline citation, as #set has no display. It seems that only using the #show afterwards will not result in the nice formatting like [1] with link to the reference section.

white space in #scite causes errors

{{#scite:
|reference=boody 20101
|type=foo bar
}}

does not equal

{{#scite:
|reference = boody 20101
|type = foo bar
}}

Most other parser functions that I have used ignore the white spacef for better readability.

Problem with Find citable metadata

Setup and configuration

  • SMW version: 2.5.1
  • SCI version: 1.2.0
  • MW version: 1.28.1
  • DB (MySQL etc.): SQLite

Issue

Using the "Find citable metadata"-Page works for me only in "Raw" mode. Searching for any DOI or other identifier results in a blank page.
The PHP error I get is "Fatal error: Call to a member function getValueFormatter() on null in /var/www/mediawiki/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_String.php on line 111".

Any idea what could be the problem?

Thanks!

Uncaught ReferenceError: onoi is not defined

Setup and configuration

  • MediaWiki | 1.35.0-rc.2 (0f1a2a2)18:43, 21 August 2020
  • PHP | 7.2.24-0ubuntu0.18.04.6 (apache2handler)
  • MariaDB | 10.1.44-MariaDB-0ubuntu0.18.04.1
  • Semantic Cite | 2.1.1 (01dc68a) 12:04, 16 May 2020

Issue

Uncaught ReferenceError: onoi is not defined
    <anonymous> https://sandbox.semantic-mediawiki.org/w/extensions/SemanticCite/res/scite.tooltip.js?ecade:153
scite.tooltip.js:153:1

Steps to reproduce the observation (recommendation is to use the sandbox):

https://sandbox.semantic-mediawiki.org/wiki/20200823?debug=true

HHVM: Fatal error: Uncaught exception 'InvalidArgumentException'

Setup and configuration

  • SMW version: master
  • SCI version: master
  • MW version: 1.26.3
  • PHP version: HHVM
  • DB (MySQL etc.): MySQl

Issue

Build job fails with ...

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The value for 'load_composer_autoloader' should be an array' in /home/travis/build/SemanticMediaWiki/mw/includes/registration/ExtensionProcessor.php:348

Stack trace

#0 /home/travis/build/SemanticMediaWiki/mw/includes/registration/ExtensionProcessor.php(173): ExtensionProcessor->storeToArray()
#1 /home/travis/build/SemanticMediaWiki/mw/includes/registration/ExtensionRegistry.php(202): ExtensionProcessor->extractInfo()
#2 /home/travis/build/SemanticMediaWiki/mw/includes/registration/ExtensionRegistry.php(127): ExtensionRegistry->readFromQueue()
#3 /home/travis/build/SemanticMediaWiki/mw/includes/Setup.php(39): ExtensionRegistry->loadFromQueue()
#4 /home/travis/build/SemanticMediaWiki/mw/maintenance/doMaintenance.php(97): include()
#5 /home/travis/build/SemanticMediaWiki/mw/maintenance/update.php(214): include()
#6 {main}

Not compatible with SWM 4.0.0

Setup and configuration

  • SMW version: 4.0.0
  • SCI version: master
  • MW version: 1.35
  • DB (MySQL etc. and version): MariaDB

Issue

After upgrading to SMW 4.0.0 the SemanticCite extension no longer works. Annotations with [[CiteRef::CitationKey]] no longer render as expected, i.e. as a citation marker[1], instead a link to the CitationKey page is shown.

Issues with HookRegistry

I am just setting up the sandbox but fail to create the table during the update.php run:

PHP Warning:  Missing argument 1 for SCI\HookRegistry::SCI\{closure}() in /.../w/extensions/SemanticCite/src/HookRegistry.php on line 121
PHP Notice:  Undefined variable: dataTypeRegistry in /.../w/extensions/SemanticCite/src/HookRegistry.php on line 123
PHP Fatal error:  Call to a member function registerDatatype() on a non-object in /.../w/extensions/SemanticCite/src/HookRegistry.php on line 123

Setup:

  • MW 1.25.2, SMW 2.2.2, PHP 5.4.45, MariaDB 5.5.45

Ask [[Citation reference::+]] no results

Setup and configuration

  • SMW version: 3.1.6
  • SCI version: 2.1.1
  • MW version: 1.34.1
  • DB (MySQL etc. and version): 10.3.22-MariaDB-0+deb10u1
  • TripleStorage: Fuseki 3.15.0

Issue: Ask failing to return Property Citation reference values

I am playing around with Semantic Cite. Have a couple of citation resources and a couple of Citation references in a page

When I run an simple ask query, to find what Citation references are in the wiki, i get no results.

I reproduce the same query in SPARQL query and I get the correct results

What seems to be causing it is SPARQL query performed by the Ask query adds a the condition ?result bibo:title ?v2 . to every query, although the property is being queried, as is the case shown in the Ask's SPARQLStore debug output:

Why would this condition be there?

Ask debug:

SPARQLStore debug output

ASK Query

[[Citation reference::+]]

SPARQL Query
PREFIX wiki: <http://oooooooooo.io/index.php/Special:URIResolver/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#>
PREFIX property: <http://oooooooooo.io/index.php/Special:URIResolver/Property-3A>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX bibo: <http://purl.org/ontology/bibo/>
SELECT DISTINCT ?result WHERE {
?result bibo:title ?v2 .
?result property:Citation_reference ?v1 .
 OPTIONAL { ?result swivt:redirectsTo ?o3 } .
 FILTER ( !bound( ?o3 ) ) .

}
ORDER BY ASC(?v2) 
OFFSET 0
LIMIT 51

'Ask query

{{#ask: [[Citation_reference::+]]
 |format=broadtable
 |limit=50
 |offset=0
 |link=subject
 |sort=Title
 |order=asc
 |headers=show
 |searchlabel=... further results
 |class=sortable wikitable smwtable
}}

SPARQL query & Results

PREFIX wiki: <http://oooooooooo.io/index.php/Special:URIResolver/>
PREFIX property: <http://oooooooooo.io/index.php/Special:URIResolver/Property-3A>
SELECT DISTINCT *
WHERE {
		SERVICE <http://sparql.oooooooooo.io/wiki/query>
		{

  			  ?s property:Citation_reference ?v .
		}
}
---------------------------------------------------
| s                                | v            |
===================================================
| wiki:RDFIO-2DMediawiki_Extension | "Byrne 2008" |
| wiki:RDFIO-2DMediawiki_Extension | "Lampa2017"  |
---------------------------------------------------

Integration with the Cite extension

This is to ask whether it is possible and feasible to have some kind of integration with the Cite extension. Both extensions can exist next to each other on one wiki instance but currently users are facing an either-or-situation on the page level since:

  1. Both extensions create their own automated numbering for the references added to a page, and
  2. Both extensions add their own section for references to the bottom of the page.

This makes a parallel usage or at least parallel usage during the transition from Cite to Semantic Cite a bit more difficult.

Wrapping citation text instead of splitting

Setup and configuration

  • MediaWiki 1.25.6 (01b4001) 21:49, 20 May 2016
  • PHP 5.6.11-1ubuntu3.4 (apache2handler)
  • MySQL 5.6.31-0ubuntu0.15.10.1
  • Semantic Cite 1.1.1 (a98b566) 18:33, 9 July 2016

Issue

It will be nice if the citation resource description gets wrapped within the respective column rather than split to several columns. See the screen shot from Help:RebuildFulltextSearchTable.php:

bildschirmfoto vom 2016-08-12 14 41 27

Compatible with SMW 4? Problems on installation

Setup and configuration

  • SMW version: 4.1
  • SCI version: ?
  • MW version: 39.2
  • DB (MySQL etc. and version): MySQL

Issue

When following the installation procedure, composer complains that SCI is not compatible with SMW 4.1 (only 3.x).
Is it actually compatible (Readme tells "Semantic MediaWiki 3.0 or later") and how then do I change the requirement to allow install without downgrading SMW?

composer update --no-dev
Could not scan for classes inside "extensions/SemanticMediaWiki//tests/phpunit/includes/" which does not appear to be a file nor a folder
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mediawiki/semantic-cite ~2.1 -> satisfiable by mediawiki/semantic-cite[2.1.0, 2.1.1].
    - mediawiki/semantic-cite[2.1.0, ..., 2.1.1] require mediawiki/semantic-media-wiki ~3.0 -> found mediawiki/semantic-media-wiki[3.0.0, ..., 3.2.3] but it conflicts with your root composer.json require (^4.1).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

Make 2.1.1 release

Tracking issue for the 2.1.1 release.

  • Finalize RELEASE NOTES
  • Update "README.md"
  • Update "/docs/"
  • Update "composer.json"
  • Update version number "extension.json"
  • Create tag
  • Add release to Wikidata
  • Update homepage
  • Announce via mail
  • Do a release tweet on Twitter
  • Run composer update on smw.o
  • Update "LocalSettings.php"
  • Start development of new version
    • Update "composer.json" (update dev alias)
    • Update "extension.json" (new alpha version)

Deprecated: Array and string offset access syntax with curly braces is deprecated

Setup and configuration

  • SMW version: 3.2.3
  • SCI version: 2.1.1
  • MW version: 1.35.4
  • DB (MySQL etc. and version): 8.0.15

Issue

When rebuilding data I get the following notices:

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 99

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 111

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 140

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/Bibtex/BibtexParser.php on line 143

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/PreTextFormatter.php on line 36

Deprecated: Array and string offset access syntax with curly braces is deprecated in /../w/extensions/SemanticCite/src/PreTextFormatter.php on line 40

Allow CiteRef annotations within #ask query results

Setup and configuration

  • SMW version: 2.4.0
  • SCI version: 1.2.0
  • MW version: 1.29.0-wmf.8
  • DB: MySQL 5.7.17

Issue

In versions of SMW before 2.4.0 [[CiteRef::...]] annotations worked when retrieved through an ask query, that is a CiteRef annotation could be stored within a text property and when displayed with an ask query the citation would be properly generated. In 2.4.0+, ask queries whose results contain a CiteRef annotation just print out the key and not a citation.

I believe this is related to SemanticMediaWiki/SemanticMediaWiki#1314

Superfluous brackets rendered in tooltip for internal links with alternative title

Setup and configuration

  • MediaWiki | 1.31.1 (632c3b6)16:10, 16 January 2019
  • PHP | 7.0.32-0ubuntu0.16.04.1 (apache2handler)
  • MySQL | 5.7.24-0ubuntu0.16.04.1
  • Semantic MediaWiki | 3.0.0 (abdec88) 22:29, 11 October 2018
  • Semantic Cite | 2.0.1 (552a56d) 13:04, 9 October 2018

Issue

If a citation text contains a wiki link with an alternative display title like

{{#scite:install:software
 |type=note
 |citation text=This help page assumes that your are only upgrading Semantic MediaWiki. In case you installed further extensions to Semantic MediaWiki the "composer.local.json" needs to be adapted accordingly. See [[Help:Installation/Example "composer.local.json" file|an example.]]
}}

adding [[CiteRef::install:software]] extra brackets will be rendered withing the tooltip like e.g. [an example.]

Example

See reference 2 on this page.

PHP Fatal error: Access level must be public

I am not sure why I got this yesterday night on "sandbox.s-mw.o" while running "rebuildData.php" since there was not editing activity for two days. Also there was no activity in the repo. I must however note that the wiki lost connection to the database a couple of times during the night, so it may be related and a false alarm.

PHP Fatal error:  Access level to SCI\DataValues\ResourceIdentifierStringValue::getPreferredCaption() must be public (as in class SMWDataValue) in /.../w/extensions/SemanticCite/src/DataValues/ResourceIdentifierStringValue.php on line 124

Setup

  • MediaWiki - 1.25.6
  • PHP - 5.6.20
  • MariaDB -10.0.25
  • Semantic Cite - master

Semantic Cite 3.0 Install Fail

Setup and configuration

  • SMW version: 4.2
  • SCI version: 3.0
  • MW version: 1.40
  • DB (MySQL etc. and version): MariaDB 10.4.22

Issue

Good Day:

I attempt to install Sematic Cite 3.0.

===Versions===
PHP: 8.0
MediaWiki: 1.40
SMW: 4.2

===Error Message===
This results with composer update

> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mediawiki/semantic-cite ~3.0, found mediawiki/semantic-cite[dev-onoi-fix, dev-master, dev-meta, 1.0.0, ..., 1.3.0, 2.0.0, 2.0.1, 2.1.0, 2.1.1] but it does not match the constraint.

Thank you
Clarence Pettis

Make 1.0.0 release

Are we cool for this? Now that SMW 2.3 is out, this extension cannot probably wait to do a world of good. :)

Make 2.1.0 release

Tracking issue for the 2.1.0 release.

  • Finalize RELEASE NOTES
  • Update "README.md"
  • Update "/docs/"
  • Update "composer.json"
  • Update version number "extension.json"
  • Create tag
  • Add release to Wikidata
  • Update homepage
  • Announce via mail
  • Do a release tweet on Twitter
  • Run composer update on smw.o
  • Update "LocalSettings.php"
  • Start development of new version
    • Update "composer.json" (update dev alias)
    • Update "extension.json" (new alpha version)

API error: badtoken

Setup and configuration

  • SMW version: 2.5.2
  • SCI version: 1.3.0
  • MW version: 1.27.0
  • DB (MySQL etc.): 10.0.29-MariaDB-0ubuntu0.16.04.1

Issue

I get a "API error: badtoken" error when I click on the "create" button after I have obtained the reference using a search for a DOI.

Semantic cite was working correctly before an upgrade of SMW from 2.4 to 2.5. Semantic cite was also upgraded.

Any ideas on the cause?

Thanks,
Colin

Having trouble with the "Find citable metadata" Special page

[0] Cereil23 wrote:

Hi. Semantic cite is a really nice extension. I am having trouble with the "Find citable metadata" Special page. For citable data of type doi, the resource created in CR:DOI does not use the DOI. For example, the DOI of 10.1109/TKDE.2006.29 creates the page CR:DOI:04369d9548555e706113abcc6f5bb453, which is not such as nice name. I get the correct behaviour for the PMID.

Also, I am having trouble obtaining the DOI from the record. Even if I map it in the template MediaWiki:Sci-property-definition using doi| has doi, I receive a blank entry from a query, although all other data that is mapped is returned correctly.
Any ideas on this?

[0] https://www.mediawiki.org/w/index.php?title=Topic:Sviz1gyxk7vnus2u&topic_showPostId=sviz1gyz4eacb0rq#flow-post-sviz1gyz4eacb0rq

Consider Zotero integration

Feature request

I haven't worked with Zotero in a while and am not up to the integration possibilities. But I am planning to investiagate in this futher.

However, several plugins/integrations exist, e.g with WordPress or Drupal, so I guess it would be a great idea to provide some form of integration from SemanticCite/MediaWiki to Zotero...

So this is a reminder for everybody interested, especially people using Zotero and SC to think about this....

mediawiki.api.parse is deprecated

FYI:

The mw.Api parse method(s) are part of the mediawiki.api module bundle as of MW 1.31 MW 1.32, leaving mediawiki.api.parse as deprecated alias, to be removed in MW 1.33.

(Found via Codesearch.)

No templates availabe on page MediaWiki:Sci-template-definition

Setup and configuration

  • SMW version: 2.5.5
  • SCI version: 1.3.0
  • MW version: 1.27.4
  • DB (MySQL etc.): MySQL 5.7.22

Issue

After installation the page MediaWiki:Sci-template-definition does not contain the template entries as described in https://github.com/SemanticMediaWiki/SemanticCite/blob/master/docs/10-template-examples.md .

A passage such as
{{#scite:Byrne 2008
|type=journal
|author=Byrne, A
|year=2008
|title=Web 2.0 strategies in libraries and information services
|journal=The Australian Library Journal
|volume=57
|number=4
|pages=365-376
}}
leads to an error: "#scite could not render a citation text for reference "Byrne 2008" because type "journal" was not assigned to a template."

Any idea?

Thank you for your help!
Maarten

Search for PMID and PMCID forbidden

Setup and configuration

  • MediaWiki 1.28.1 (819c0d2) 00:51, 7 April 2017
  • PHP 5.6.30-0+deb8u1 (apache2handler)
  • MariaDB 10.0.30-MariaDB-1~jessie
  • Semantic MediaWiki 3.0.0-alpha (63c9206) 08:48, 11 May 2017
  • Semantic Cite 1.4.0-alpha (c0368d4) 08:48, 11 May 2017 GPL-2.0+

Issue

A search via special page "FindCitableMetadata" returns:

The REST/HTTP request returned with "The requested URL returned error: 403 Forbidden" for "5348191".

Perhaps they have changed their API. The search for DOIs is working as expected.

Steps to reproduce the observation (recommendation is to use the sandbox):

'and' separator and names ending with 'and'

Here is an example:
An author with last name Egeland is causing some problems with the parser, as it is interpreting the 'and' part of 'Egeland' as the 'and' separator. Because there is an 'and' separator to the next author, this produces an empty author name.

#scite: not rendering (no errors)

Setup and configuration

  • SMW version: 3.2.2
  • SCI version: 2.1.1
  • MW version: 1.35
  • DB (MySQL etc. and version): mySQL

I suspect the problem has something to do with my MediaWiki:Sci-template-definition page, but I can't find a working example to double check aginst. I have run into issues with white space (another issue), so maybe it doesn't like the templates to have /. It's just hard to tell with not error message.

Example page:
https://www.crewsgenealogy.com/wiki/Test

{{#scite:
|reference=boody 20101
|type=1790-1810-Census-Citation-Listing
|census year=1790
|district=test district
|state=test state
|page=test page
|line=test line
|person of interest=test person of interest
|source site=test source site
|accessed date=test accessed date
|roll=test roll
|source site url=test source site url
|accessed year=test accessed year
}}

contents of MediaWiki:Sci-template-definition:

A list of citation types that are mapped to predefined templates containing citation formatting rules. 
 1790-1810-Census-Citation-Listing|1790-1810 Census/Semantic/Citation Listing
 1790-1810 Census Source Listing|1790-1810 Census/Semantic/Source Listing
 1790 Census Citation Listing|1790-1810 Census/Semantic/Citation Listing
 1790 Census Source Listing|1790-1810 Census/Semantic/Source Listing
 1800 Census Citation Listing|1790-1810 Census/Semantic/Citation Listing
 1800 Census Source Listing|1790-1810 Census/Semantic/Source Listing
 1810 Census Citation Listing|1790-1810 Census/Semantic/Citation Listing
 1810 Census Source Listing|1790-1810 Census/Semantic/Source Listing

content of Template:1790-1810 Census/Semantic/Citation Listing

<includeonly>[[United States Census, 1790|{{{census year|}}} U.S. census]], {{{district|}}} District, {{{state|}}}, p. {{{page|}}}, line {{{line|}}}, {{{person of interest|}}}; image, database, {{{source site|}}} Online: (accessed {{{accessed date|}}}); citing National Archives microfilm {{#switch: {{{census year|}}}
|1790 = M-637
|1800 = M-32
|1810 = M-252
}}, roll {{{roll|}}}.</includeonly><noinclude>{{documentation}}</noinclude>

Semantic Cite Update

Good Day:

Semantic Cite is an excellent extension. But I have FOMO for the latest Semantic MediaWiki.

I have failed to install Semantic Cite under: MediaWiki higher than 1.35.x and Semantic MediaWiki higher than 3.2.3.

I have attempted without success:
composer update --with-all-dependencies
composer composer update --no-dev

I have attempted this on a Mac, on Windows 10 and 11 using XAMPP and under Windows 11 > WSL2 > Ubuntu 20.04. Retrying is an annual hobby.

My present versions:
Windows 11
Microsoft WSL2
Ubuntu 20.04.
PHP: 7.4.3
MariaDB: 10.3.39
MediaWiki: 1.35.10
Semantic MediaWiki: 3.2.3
Semantic Cite: 2.1.1

My wiki is local only; no external access.

Here is an error message. Please excuse my use of PRE tags.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mediawiki/semantic-cite ~2.1 -> satisfiable by mediawiki/semantic-cite[2.1.0, 2.1.1].
    - mediawiki/semantic-cite[2.1.0, ..., 2.1.1] require mediawiki/semantic-media-wiki ~3.0 -> found mediawiki/semantic-media-wiki[3.0.0, ..., 3.2.3] but it conflicts with your root composer.json require (~4.1).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Thank you
Clarence Pettis

Make 2.0.0 release

Tracking issue for the 2.0.0 release.

  • Finalize RELEASE NOTES
  • Update "README.md"
  • Update "/docs/"
  • Update "composer.json"
  • Update version number "extension.json"
  • Create tag
  • Add release to Wikidata
  • Update homepage
  • Announce via mail
  • Do a release tweet on Twitter
  • Run composer update on smw.o
  • Update "LocalSettings.php"
  • Start development of new version
    • Update "composer.json" (update dev alias)
    • Update "extension.json" (new alpha version)

Install without composer?

Setup and configuration

  • SMW version: 2.4.1
  • MW version: 1.27.1
  • DB: PostgresSQL

Howto install without composer / shell access

I tried to install the extension without shell access. Download from git, datatransfern on my server via sftp and added the line require_once("$IP/extensions/SemanticCite/SemanticCite.php"); to my LocalSettings.php but this doesn't work. Any suggestions?

Thanks!

jabref bibxml to scite conversion

The script below allows to convert jabref bibxml content to be converted to SemanticCite.
To use the script use the copy/export to clipboard functionality of JabRef and then run the script on the command line.
The "clipboard" npm tool and jq/xq are used by this tool as well as the https://pypi.org/project/pylatexenc/

scite

#!/bin/bash
# convert bibtex xml to #scite format
# WF 2021-06-01

#ansi colors
#http://www.csc.uvic.ca/~sae/seng265/fall04/tips/s265s047-tips/bash-using-colors.html
blue='\033[0;34m'
red='\033[0;31m'
green='\033[0;32m' # '\e[1;32m' is too bright for white bg.
endColor='\033[0m'

#
# a colored message
#   params:
#     1: l_color - the color of the message
#     2: l_msg - the message to display
#
color_msg() {
  local l_color="$1"
  local l_msg="$2"
  echo -e "${l_color}$l_msg${endColor}"
}

#
# error
#
# show the given error message on stderr and exit
#
#   params:
#     1: l_msg - the error message to display
#
error() {
  local l_msg="$1"
  # use ansi red for error
  color_msg $red "Error:" 1>&2
  color_msg $red "\t$l_msg" 1>&2
  exit 1
}


# show usage
#
usage() {
  echo "$0 [-h|--help]"
  echo ""
  echo "-h | --help: show this usage"
  exit 1
}

#https://stackoverflow.com/questions/749544/pipe-to-from-the-clipboard-in-bash-script
which clipboard > /dev/null
if [ $? -ne 0 ]
then
  color_msg $blue "installing clipboard helper"
  npm install -g clipboard-cli
fi

while [  "$1" != ""  ]
do
  option="$1"
  case $option in
    -h|--help) usage;;
  esac
  shift
done

xml=$(clipboard)
echo $xml | grep "<?xml version" > /dev/null
if [ $? -ne 0 ]
then
  error "expected bibtex xml in clipboard"
fi
pcode=/tmp/pcode$$.py
cat << EOF > $pcode
import json
import sys
from pylatexenc.latex2text import LatexNodes2Text

def unlatex(latex):
  '''
  convert latex code back to "normal"
  '''
  utf8=LatexNodes2Text().latex_to_text(latex)
  return utf8

bib=json.load(sys.stdin)
print (bib)
if "file" in bib:
  f=bib["file"]
  if "entry" in f:
    e=f["entry"]
    id=e["@id"].replace("_","")
    types=["article","inproceedings"]
    for type in types:
      if type in e:
        a=e[type]
        print(f"[[CiteRef::{id}]]")
        print(f"{{{{#scite:{id}")
        print("|type=article")
        for key,value in a.items():
          value=unlatex(value)
          print(f"|{key}={value}")
          print("}}")
EOF

echo $xml | xq . | python3 $pcode
rm $pcode
# {
#  "file": {
#    "@xmlns": "http://bibtexml.sf.net/",
#    "entry": {
#      "@id": "Auer_2021",
#      "article": {
#        "author": "Sören Auer and Markus Stocker and Lars Vogt and Grischa Fraumann and Alexandra Garatzogianni",
#        "title": "{ORKG}: Facilitating the Transfer of Research Results with the Open Research Knowledge Graph",
#        "journal": "Research Ideas and Outcomes",
#        "year": "2021",
#        "volume": "7",
#        "month": "May",
#        "doi": "10.3897/rio.7.e68513"
#      }
#    }
#  }
#}

ArgumentCountError from line 180 of HookRegistry.php: Too few arguments to function SCI\HookRegistry::onDataTypeInit()

Setup

Product Version
MediaWiki 1.35.11 (9891838)22:58, 25 July 2023
PHP 7.4.33 (apache2handler)
MariaDB 10.5.19-MariaDB-0+deb11u2
Semantic MediaWiki 4.1.2 (34c5806)

Issue
Semantic Cite no longer works with SMW 4.1.2. After upgrading to SMW 4.1.2 the following error is shown:

[7fe53c4393abcc686550a091] /wiki/Accueil ArgumentCountError from line 180 of /../w/extensions/SemanticCite/src/HookRegistry.php: Too few arguments to function SCI\HookRegistry::onDataTypeInit(), 0 passed in /../w/includes/HookContainer/HookContainer.php on line 329 and exactly 1 expected

Backtrace:

#0 /../w/includes/HookContainer/HookContainer.php(329): SCI\HookRegistry->onDataTypeInit()
#1 /../w/includes/HookContainer/HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#2 /../w/extensions/SemanticMediaWiki/src/DataTypeRegistry.php(515): MediaWiki\HookContainer\HookContainer->run()
#3 /../w/extensions/SemanticMediaWiki/src/DataTypeRegistry.php(130): SMW\DataTypeRegistry->initDatatypes()
#4 /../w/extensions/SemanticMediaWiki/src/PropertyRegistry.php(91): SMW\DataTypeRegistry::getInstance()
#5 /../w/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php(98): SMW\PropertyRegistry::getInstance()
#6 /../w/extensions/SemanticMediaWiki/src/Protection/ProtectionValidator.php(328): SMW\DIProperty->__construct()
#7 /../w/extensions/SemanticMediaWiki/src/Protection/ProtectionValidator.php(193): SMW\Protection\ProtectionValidator->checkProtection()
#8 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Permission/TitlePermissions.php(110): SMW\Protection\ProtectionValidator->hasEditProtectionOnNamespace()
#9 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Permission/TitlePermissions.php(64): SMW\MediaWiki\Permission\TitlePermissions->hasUserPermission()
#10 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks/TitleQuickPermissions.php(58): SMW\MediaWiki\Permission\TitlePermissions->checkPermissionFor()
#11 /../w/extensions/SemanticMediaWiki/src/MediaWiki/Hooks.php(1197): SMW\MediaWiki\Hooks\TitleQuickPermissions->process()
#12 /../w/includes/HookContainer/HookContainer.php(329): SMW\MediaWiki\Hooks->onTitleQuickPermissions()
#13 /../w/includes/HookContainer/HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#14 /../w/includes/HookContainer/HookRunner.php(4019): MediaWiki\HookContainer\HookContainer->run()
#15 /../w/includes/Permissions/PermissionManager.php(753): MediaWiki\HookContainer\HookRunner->onTitleQuickPermissions()
#16 /../w/includes/Permissions/PermissionManager.php(409): MediaWiki\Permissions\PermissionManager->checkQuickPermissions()
#17 /../w/includes/Permissions/PermissionManager.php(243): MediaWiki\Permissions\PermissionManager->getPermissionErrorsInternal()
#18 /../w/includes/Permissions/PermissionManager.php(262): MediaWiki\Permissions\PermissionManager->userCan()
#19 /../w/includes/page/Article.php(682): MediaWiki\Permissions\PermissionManager->quickUserCan()
#20 /../w/includes/actions/ViewAction.php(80): Article->view()
#21 /../w/includes/MediaWiki.php(531): ViewAction->show()
#22 /../w/includes/MediaWiki.php(313): MediaWiki->performAction()
#23 /../w/includes/MediaWiki.php(947): MediaWiki->performRequest()
#24 /../w/includes/MediaWiki.php(547): MediaWiki->main()
#25 /../w/index.php(53): MediaWiki->run()
#26 /../w/index.php(46): wfIndexMain()
#27 {main}

Named template parameters in ResourceFormatter

Semantic cite uses templates to format the citation, an example is journal|SciteAPAJournalResourceFormatter. I have constructed one using the named parameters such as {{{issue}}} which is mapped correctly using property mapping.

However, an issue is occurring when {{{issue}}} does not exist in the citation imported with the Find citable metadata special page. If the parameter exists, I get the issue number as expected in the citation. However, if there is no issue number, I get {{{issue}}} which does not look very nice in the citation.

Is there a way to solve this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.