semantic-mediawiki.org:Community portal

From semantic-mediawiki.org
(Redirected from Talk:Semantic MediaWiki)
Jump to: navigation, search
Community portal of Semantic MediaWiki

Welcome to the community portal. This is the place for general inquiries, your ideas or comments concerning this wiki. Here you may get in touch with one of the admins of this wiki, who also use this portal as a noticeboard.

If you are looking for support with problem about the software itself, please have a look at the info page on getting support.


We are always looking for ways to improve documentation and communication with the community therefore it would help us if you could take 5 minutes of your time and fill out the survey form. Thank you.

First page
First page
Previous page
Previous page
Last page
Last page

Issues with the "sep" function in mode Query template.

There is a issue since the 2.1 SMW version when we use a "sep" function with the Template format.

Here is the code:

{{#ask: [[Category:City]] [[located in::Germany]]
              | format = template
              | template = Link
              | sep =  • 
              | link = none
}}.

Here is the result:

Demo:BerlinDemo:CologneFrankfurtMunichStuttgartDemo:Würzburg

There should be a separator between the each value. That's not the case obviously. It seems to be a bug.

LIMAFOX76 (talk)17:05, 24 August 2015

`sep` is only used as divider for when multiple values are assigned to same field (property) for querys like:

{{#ask: [[Category:City]] [[located in::Germany]]
 |?Has something --> used by/for sep

The template has to care for the formatting, values do not contain arbitrary separators (except those concatenated of multiple values) that weren't part of its value declaration.

You can make a feature request [0] to have the `sep` parameter made available as {{{sep}}} in a template (so it can be used further within a template).

BTW: I tested it against 1.9.2.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/

MWJames (talk)18:14, 24 August 2015

Yet it's working on a version 1.8

Here are the link (bottom template): http://stargate.shoutwiki.com/wiki/MacKenzie_%28doctor%29

And now the same template on a 2.1.3 version: http://battlestar.wiki/Mod%C3%A8le:Palette_Personnages

LIMAFOX76 (talk)22:18, 24 August 2015
 
 

Using SMW to query Anchors

Good day:

My Versions: MediaWiki: 1.25.1 | PHP: 5.6.8 | MySQL: 5.6.24 Semantic MediaWiki: 2.2.1 | Lingo: 1.2.0 | Semantic Glossary: 1.1.0

I searched the MediaWiki website for the phrase “Anchor”.

About 13 items down in the Search results I see an entry like the following:

Manual:PAGENAMEE encoding (section Whitespaces in page names and anchors (section headings))

The search returns a particular anchor inside an article.

Is there a way that I can use MSW to mark MediaWiki anchors so that I can get an SMW query to return anchors?

AKSHA (talk)02:54, 29 July 2015

Looks like that you should use subobjects instead of or in addition to anchors.

Alexander Mashintalk04:05, 30 July 2015

Thank you Alexander:

Could you say a little more please? I use subobjects presently. They are very good for precisely querying articles.

Is there a way to arrange a subobject so that a query it returns a section of an article?

Perhaps there is some alternative way to create sections in an article?

AKSHA (talk)13:43, 30 July 2015

I'm not quite sure I understand the issue/question but what if you create a page `ArtitlceWithSection` that contains:

{{#subobject:
 |Has page=ArticleWithSection
 |Has section=ArticleWithSection#abc
}}{{#subobject:
 |Has page=ArticleWithSection
 |Has section=ArticleWithSection#123
}}

{{#ask: [[Has page::+]][[Has section::+]]
 |?Has section
}}

== abc ==

== 123 ==

The query should display and link to the correct section.

MWJames (talk)17:29, 30 July 2015

Good morning:

Honestly; I saw that a search on Wikipedia or MediaWiki could return sections of articles as well as articles. I wanted that precious ring and was told it was accomplished using CirrusSearch. I failed to get CirrusSearch working and got lost trying to follow the detailed configuration advice. Is this because I am using the latest MediaWiki version? Is it because of some configuration I have not done on my wiki? Is it because of subtle CirrusSearch requirements?

The answer to these questions, clearly, was to see if I could have a search of my wiki return article sections by relying solely on SMW.

The solution you provide works neatly and is easy. Thank you Alexander.

I worry that a subobject per anchor adds some overhead per anchor in an article across the wiki. That is to say that it is more work.

In addition to a subobject per anchor; I see that I can shift to a larger number of shorter articles.

Shorter articles will leave me better able to zoom in on a very specific topic without being able to query sections of an article.

Then I will want to mitigate that my articles are become grains of sand on a beach.

I can give each short article a subobject. I can then query to organize related short articles to create a more inclusive article using the Embedded Format.

http://semantic-mediawiki.org/wiki/Help:Embedded_format

Sorry to be verbose. Thanks to the forum.

AKSHA (talk)14:43, 7 August 2015
 
 
 
 

Purge deleted properties

Hello all.


After i create a property with "Special:property" and delete it, whenever i go to "Special:createTemplate" i can still choose it as an element of the template (even if it should no longer exist). I understand that property itself does not longer exist (does not have nothing on it), and that when you use it, you are kind of creating it.

Anyway, i would like that after deleting it, it´s name also dissapeared, as if it had never existed before, so does not show up when you want to create a template.

How could i do this?

Thanks.

Maiser (talk)16:05, 23 March 2015

My Versions: MediaWiki: 1.25.1 | PHP: 5.6.8 | MySQL: 5.6.24 Semantic MediaWiki: 2.2.1

If you have articles that use the deleted property; you will continue to see the deleted property among existing properties. Cleaning up articles to remove references to the deleted property can help.

I have also seen improvement by using maintenance scripts.

Deleting Unused Content[edit]

deleteOldRevisions.php[edit]

This deletes old revisions from the database.

php deleteOldRevisions.php --delete

http://www.mediawiki.org/wiki/Manual:DeleteOldRevisions.php


deleteArchivedRevisions.php[edit]

This deletes deleted pages from the database.

php deleteArchivedRevisions.php --delete

http://www.mediawiki.org/wiki/Manual:DeleteArchivedRevisions.php


Hurrying Jobs[edit]

The folowing speeds up pending jobs.

runJobs.php

http://www.mediawiki.org/wiki/Extension:Replace_Text#Known_issues

It is demanding and can freeze the server, so I don't do it.


The following is less demanding and does not freeze the server.

php runJobs.php --maxjobs 1000

I run this from an XAMPP cmd window of the Maintenance directory. It runs pretty fast. It does not remove phantom properties by itself.

You may may have already done enough to remove the phantom property and just be waiting for the job that eliminates references to it. In that case this will help.

AKSHA (talk)02:47, 29 July 2015
 
 

Album-to-song and tracklists relationships

Hi. First of all, thanks for SMW, a great software solution. I've just discovered it recently, and it looks really cool. I'm a long-time MediaWiki user and maintain a public music band wiki. I'm going to start a new project and now I would like to introduce SMW to avoid the existing wiki problems. I have a local playground where I do my SMW experiments, and I'm wondering if it's possible to make an album tracklist solution (one-to-many). Let's say, there is an album titled ALBUM and it contains the following template invocation:

{{Tracklist
| TRACK1
| TRACK2
| TRACK3
| TRACK4
}}

The Tracklist template is as follows:

<includeonly>
{{#fornumargs: I
| V
| {{#set:
  Type=tracklist
  |Collection={{FULLPAGENAME}}
  |Version={{{Version|}}}
  |Index={{#var: I}}
  |Song={{#var: V}}
  }}
}}
</includeonly>

It produces:

{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG1}}
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG2}}
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG2}}
{{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG4}}

And when, by my intention, I'm trying to query a tracklist for the album, I get a grouped result unfortunately (as far as I understand, this is how SMW works):

==Tracklist==
{{#ask: [[Type::tracklist]]
|?Collection
|?Version
|?Index
|?Song
}}

turns into a one-row table (format=ol produces a single line list) because of grouping:

+---------+------------+---------+-------+--------+
|         | Collection | Version | Index | Song   |
+---------+------------+---------+-------+--------+
|         |            |         | 1     | SONG 1 |
|         |            |         +-------+--------+
| ALBUM   | ALBUM      |         | 2     | SONG 2 |
|         |            |         +-------+--------+
|         |            |         | 3     | SONG 3 |
|         |            |         +-------+--------+
|         |            |         | 4     | SONG 4 |
+---------+------------+---------+-------+--------+

After all, the whole ALBUM just got 4 properties, and this is why the result is grouped. I would like to "ungroup" it as if it's a SQL-like query without a GROUP BY clause. The only solution I see is spreading the tracklist information onto each of 4 song pages, like {{#set|Type=tracklist|Collection=ALBUM|Version=|Index=1|Song=SONG1}} thus associating the tracklist album/index with a particular song, not the album itself where I'd expect to store the actual tracklist I used to do in my existing non-SMW wiki. This may look unusual, odd and violationg the SMW principles. Sorry for probably a vague explanation.

My question is as follows: what would you suggest to "ungroup" the result? Does my SQL-like idea violate the SMW principles? Any comments are appreciated. Thanks!

Halo (talk)01:34, 25 June 2015

To build a one-to-many relationship for a subject (e.g. Album entity) it would be best to use the #subobject instead of #set.

{{#subobject:
 |Type=tracklist
 |Collection={{FULLPAGENAME}}
 |Version={{{Version|}}}
 |Index={{#var: I}}
 |Song={{#var: V}}
}}
{{#ask: [[Collection::{{FULLPAGENAME}}]]
 |?Version
 |?Index
 |?Song
 |mainlabel=-
}}

See also Examples/Queries/Subobject to display table rows

> music band wiki. I'm going to start a new project and now

You may want to look at [0] to get some ideas about a music related wiki that uses SMW.

[0] http://tangowiki.org/wiki/Main_Page

MWJames (talk)20:38, 25 June 2015

This is interesting. I'm currently testing it, and it seems to be what I want. Thank you!

Halo (talk)11:08, 28 June 2015
 

One more question, please. Is it possible to refer the properties defined at the "sub/child"-pages? I would like to extend the above template/table output with the "Length" column so it could look like a real tracklist. The ?Song property refers to song pages, and every song page has a song definition with the Length property set. It's like the INNER JOIN operation, but I feel like I'm abusing SMW capabilities (and it looks like I'm more of finding a search mechanism like XPath). Is it possible somehow?

Halo (talk)21:16, 28 June 2015

In case you go with the #subobject then your data model will most likely be something like:

  • An ALBUM is represented by a wikipage ->
  • Subobjects are embedded in a page to represent each individual song ->
  • Each song has attributes like:
    • Song title
    • Song index
    • Song length
    • Song author/composer/writer (optional in case it is a compilation where a song can have different writers from the Album)
    • etc.

As demonstrated you attach attributes/properties to an individual song which a #subobject not a page (we are talking about an entity)

If you want to split an ALBUM/SONG by page/subpage then you can take a similar approach only that subobjects need to contain a reference to the album.

For example, looking for an album of song writer YYY where you want to see songs with title and length -> [[Has song writer::YYY]]|?Song title|?Song length.

MWJames (talk)16:02, 7 July 2015

It sounds promising. I'll try your suggestion as soon as possible. Thank you very much!

Halo (talk)19:59, 13 July 2015
 
 
 
 

The task for SMW or not?

I need to solve the following problem: there are several thousands of pages, and each page contains a variety of unique labels (up to several dozen). These labels are unique globally and I need be able to find the page on the label. It is clear that, in theory, this problem can be solved by standard Mediawiki redirects, but they are difficult to automatically create (or remove when modifying pages).

Question: how far is it appropriate to solve this task by means of SMW?

StasR (talk)10:17, 5 July 2015

What is a "label", how is it defined in the wikitext, and how do you ensure that it's globally unique?

Yaron Koren (talk)01:10, 6 July 2015

There are partial dumps of external database, these labels - unique keys in the database. I will convert the dump to xml for import into wiki, so I can include labels into the body of tag pages in any form. When parsing I can resolve internal links within a single partial dump, but links to other parts (already included in the wiki, or included in the future) should be linked by means of mw / smw / something else.

StasR (talk)10:17, 6 July 2015

Alright. What's a "tag page", and what does it mean to resolve an internal link?

Yaron Koren (talk)21:54, 6 July 2015

If the page refers to labels that have been defined on another page of the same partial dump, then I convert it into a normal Wiki link when I convert the dump to XML.

StasR (talk)22:39, 6 July 2015

I don't know, I still don't really understand the question. Hopefully someone else can help you.

Yaron Koren (talk)22:18, 8 July 2015
 
 
 
 

I may confer with the previous commenter not being able to see the full extend of what you want to achieve but for what it's worth maybe the following datamodel can help.

Have your labels that point (from the origin subject) to (or from) the source being collected as part of a subobject like:

Page "SomeSubject" that relates to:

{{#subobject:
 |Has label=One,Two,Three,...|+sep=,
}}

With above statement you should be able the search for labels that point to the subject that contain those labels without having to create any redirects.

{{#ask: [[Has label::~*Two*]] }}

If the search of a subject that contain some of those labels (with "Has label" being of either "Page" or "Text" type) is not your primary objective then you need to clarify the intention of your DM.

MWJames (talk)08:50, 9 July 2015
 

Semantic Forms: Forminput with Multiple Rows

Hey, like I wrote above, I would like to create a forminput multiple input fields. I want to do that because our workers always mess up the form Name and put in to many spaces or delete the commas. I hope you understand what I mean, if not I try to explain it better with this:

Currently our Forminput looks like this

{{#forminput:Installation|70|Installation: Ort,Projektname,Rechner1}}

and after that comes the rest of the form.

Now this is only one input row, and I want three input rows where each contains a part of the title.

Ort:

Projektname:

Rechner:


If it stays like this our workers keep messing up the title names and sometimes the names are full of underlines.

Sorry for my bad english, if there is something not clear I try my best to edit it.

Arty (talk)08:10, 15 June 2015

Have a look at the one step process. So the form should have something like {{{info|page name=Installation: <Installation[Ort]> <Installation[Projektname]> <Installation[Rechner]>|add title=Installation erfassen|edit title=Installation bearbeiten}}}. The best and fastest entry point to help regarding Semantic Forms is this talk page. Cheers

[[kgh]] (talk)20:20, 15 June 2015

Okay thanks for helping me, but somehow this won't work for me

When i try the info tag it only prints the stuff thats in the first "bracket" like I put in your code and it only prints "page name=Installation: <Installation[Ort]> <Installation[Projektname]> <Installation[Rechner]>"

Then when you put other things in the first place it for examples prints "add title=Installation erfassen"

Maybe I'm just overlooking something but it would be nice if you could also help me out with this problem

Arty (talk)08:05, 17 June 2015

> Maybe I'm just overlooking something but it would be nice if you could also help me out with this problem

Unfortunately this forum is mostly concerned with SMW-core questions and #forminput is a specific SF question (and is not related to SMW) therefore it would be best to ask the maintainer [0] directly.

[0] https://www.mediawiki.org/wiki/Extension_talk:Semantic_Forms

MWJames (talk)15:31, 17 June 2015
 
 
 

fresh install and semantic bundle question

Hi, I want to make a fresh install from source on a redhat 6 64 bit system. Is the order of things to get a working mediawiki, then add the semantic mediawiki extensions? What is the advantage of the bundle? I read the docs but am not clear on what exactly it is and if that would be the best bet for a fresh install. If I install the bundle does it install the extension too? I am assuming with either approach I need to have a working recent (i.e. not rhel6 repo) mediawiki in first. Is that correct? Sorry for such basic questions, but I want to avoid installing the wrong way.

I am particularly excited by the inline query abilities. is SMW the only platform that offers this? Everything else I looked at is only able to query and return rdf in big chunks like tables and we have several projects that could really use the inline query method to good advantage.

Thanks for answering n00b question!

Rcrath (talk)04:16, 13 May 2015

> I read the docs but am not clear on what exactly it is and if that would be the best bet for a fresh install.

Have a look at the video [0] which should give a clear picture of how a fresh install can be achieved. For details on the specific installation requirements, see the Installation help.

> mediawiki in first. Is that correct?

MediaWiki first, SMW comes second as it requires MW to be working.

> What is the advantage of the bundle?

If you talk about the SemanticBundle, not much and it only supports SMW 1.9.2 which is no longer under active maintenance. The current SMW release is 2.2.

If you want install SMW related extensions such as SRF (see [1]) or SM just follow the specific installation guideline of that extension you want to install.

The following list contains details about SMW extensions available via Composer.

If you can`t use Composer, see the tarball installation guideline.

> Sorry for such basic questions

You might also have a look at Help:Getting started.

[0] https://vimeo.com/82255034

[1] https://vimeo.com/82258857

Cheers

MWJames (talk)03:47, 14 May 2015

@MWJames, thanks, I'll watch the videos. I didn't pay attention to videos because I am impatient and like documents, so mea culpa and thanks for the pointer. I can use composer and thanks for answering my query re: the bundle.

Rcrath (talk)07:21, 28 May 2015
 
 

Problems uploading and deleting files

Hello,

i have enable file upload with $wgEnableUploads=true; in the LocalSettingsp.php, but i am having some problems.

Each time i try to download a file, i will get a screen which says:

Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594

That line stands for this peace of code:

static public function getDataItemExpElement( SMWDataItem $dataItem ) { return self::$dataItemToElementEncoder->mapDataItemToElement( $dataItem ); }


Anyway, even if i get that error, file gets uploaded to the repository.

Afterwards, when i go to repository and i try to delete that file i get:

Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594

Exactly the same error, but this time the file will not be deleted.


What is causing this and how could i solve it?

Atm i am installing the semantic media wiki on a free host (hostinger), which uses linux's Centos 5.5 distribution i believe, do not know if that has an influence.

Maiser (talk)13:52, 27 May 2015

> Fatal error: Call to a member function mapDataItemToElement() on a non-object in /home/u480878357/public_html/mediawiki/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php on line 594

This error can virtually not happen because each call in SMW is using `Exporter::getInstance()->getDataItemExpElement` and there should be not one single caller that is executing `Exporter::getDataItemExpElement` directly therefore I cannot tell as to what happens on your installation. Furthermore, the upload is tested against SQLStore and SPARQLStore with a real upload process [0].

Having the complete stack trace would help in guessing where `Exporter::getDataItemExpElement` is called from.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Integration/MediaWiki/Hooks/FileUploadIntegrationTest.php

MWJames (talk)14:29, 27 May 2015

Ok, problem was definitively coming from:

http://www.mediawiki.org/wiki/Extension:RDFIO

which was calling that function. Going to try to solve it by making a clean instalation of it again (to see if i made an error, even if i know pretty much for sure that it sometimes randomly fails, from previous local instalations) and if that does not the thing, i will go for the complete stack trace.

Many thanks.

Maiser (talk)14:45, 27 May 2015

> Ok, problem was definitively coming from:

http://www.mediawiki.org/wiki/Extension:RDFIO

The `Exporter` should always be called using `Exporter::getInstance()->...`.

MWJames (talk)14:50, 27 May 2015
 
 
 
 

Making URL look better

Hey,


is there any way making an URL look better?

for example if i have a link to an image of a galaxy:

http://www.jpl.nasa.gov/spaceimages/images/mediumsize/PIA17011_ip.jpg

And i want the link just to say "galaxy" but making it able to access the image in one click, how would i do it?

Thanks!


EDIT:

Here is the link, should have looked it first at media wiki, kind of out of topic here lol, did not thought about it. Still there is no way to delete this post so i will just give the answer:

http://www.mediawiki.org/wiki/Help:Links

Maiser (talk)21:17, 21 May 2015

Translating categories

Hello,


i hope there is a simple way of doing this! I have just imported some vocabulary from DublinCore ontology and of course, it is all in english. This vocabulary is located in "categories" and "properties". I want that instead of displaying it in english, whenever a user changes the language of the wiki, these vocabulary shows up in that language.


Perhaps there is some label of type [[lang:(language)->show.....]] r something like this.


Could someone help me with this?

Maiser (talk)14:48, 2 April 2015

Sounds impossible.

Alexander Mashintalk04:03, 3 April 2015
 

Just contact me via one of my social links and I'll give you support for this issue.

WolfgangFahl (talk)01:57, 11 May 2015
 

Any way to create a bunch of pages without having to make clicks for each insertion?

Hello,


Is there any way to do this? For example if i want to introduce 10 different pages (each one with it´s own name). Perhaps a directory in where you can introduce pages information directly, or an extension which makes available to introduce more than one page in a click (dividing one perhaps, which an speficic syntax).

Maiser (talk)16:37, 17 April 2015

Ok, seems like "Data transfer" extensions is pretty easy to manage. Just modify XML type data manually and make and import will create all pages we have defined.

http://www.mediawiki.org/wiki/Extension:Data_Transfer

Maiser (talk)20:49, 17 April 2015

The smartMediaWiki approach helps creating pages dynamically. See my talks at SMW Con Spring 2015

WolfgangFahl (talk)01:56, 11 May 2015
 
 

How to hide the "Previsualization message"

I want to add some pre-made questions, were user just have to feel a box , make a click, and obtain the answer.

In order to do this i used semantic forms+templates, so that if for example i want to ask "Which are the contributions of a particular user (articles, links, extensions.... basically all in were user is tagged, can be accessed in a organized way just by putting his name in a box and clickig.


For this i converted the "preview" button, in something which takes the value of the box and launches the inline query (#ask) from the template without saving it as a page, obviously.


Problem is that upwards i get this message telling me that "this is a previsualization message....." which i want to get rid of.

Any way to do this?

Maiser (talk)17:32, 7 May 2015

That's not really a question related to this website. ;) I guess you just have to blanc the respective system message in the MediaWiki namespace. Cheers

[[kgh]] (talk)17:56, 7 May 2015
 

How do I build a query that counts pages by category or subcategory?

Consider this simple situation:

I have a category called Parent Category with two sub categories called First Child and Second Child.

I have a Page A and a Page B that have the category First Child. I have a Page C has the category Second Child.

What I want to do is count the number of pages in each category. I can get a count of pages under the Parent Category: { { #ask: [ [Category: Parent Category] ] | format = count} }

I can produce a table of pages by category: { { #ask: [ [Category: Parent Category] ] | format = table} }

But, how do I do both so that I have a table that looks like this:

Category Count
first child 2
second child 1

I've tried a few things without success. Here is one example: { { #ask: [ [Category: Parent Category] ] | ?Category | ?count | format = table } }

Any advice you have would be appreciated.

Dulani (talk)20:55, 22 April 2015
  1. Make sure semantics is enabled for category pages,
  2. define Template:Count pages in category as {{#ask: [[Category:{{{1}}}]] | format = count}},
  3. insert query {{#ask: [[:Category:+]] [[Category:Parent category]] | link = none | format = template | template = Count pages in category}} into your page,
  4. submit and wait forever until the page is parsed.
Alexander Mashintalk04:00, 23 April 2015
 

Mixing properties with categories

Hey,

i will put an example to make this question as brief as possible:

I create a category called "Book".

I create a property called "Book"


I create a template called "Lectures" which has one property called "Bookings" which uses "Book" property.

I create a form using this template, and maintain this property with the same name.

I go to "Lectures" form, and create an article with it, which includes a Book (as it was it´s property).


So, this property will appear in "properties:Book", but not in "categories:book".

How can i make that when someone fills a form with a property name which is also a category(apart from property", it appears also as category?


I am asking this because i am making an structure were i want to link 2 categories.

For example if i have a category "teacher" and "school", and i want to know where the teacher teaches, i can only make a form using "properties", so that if i make a property named "school" in "teacher" form, this will not appear in "category:school", but in "property:school", so they are not really connected between them.

To sum up: I would need something that says "if they have the same name, "property:x"="category:x".

Or something which makes a property able to point to an specific category.

Maiser (talk)10:15, 6 April 2015

Please have a look at Help:Category vs. property and Help:Adding_subobjects#Using_categories (it should give you some insights about the category vs property issue).

> "property:x"="category:x"

property:x is about the thing x, while category:x is about a class x.

In your "world" ("world" in a sense of the wiki that hosts your content and ultimately your facts model) you can make it appear to be represent the same entity of knowledge but for SMW (in core) a category and a property are distinguished hence not mixed with each other.

> How can i make that when someone fills a form with a property name which is also a category(apart from property", it appears also as category?

This should be possible to achieve in your template with some if/else statements. Please remember, input is done by the form but the actually annotation is added by the template (after the input processing has finished).

MWJames (talk)11:24, 6 April 2015

Ok, i read those and have been trying to achieve it through subobjects, but something it going wrong. If it is not much demanding, could you please tell me an example?

For example having a category "Teacher" with has as a property in its template called "Subjects", which refers to the subjects he/she teaches, and having a Category called "Subject" which i want to be automatically filled when someone fills the Teacher form.

Maiser (talk)01:43, 7 April 2015

> Ok, i read those and have been trying to achieve it through subobjects,

The links were only listed to illuminate the issue about category vs. property and how SMW interprets both entity description types.

> could you please tell me an example?

If you look at the bottom of Template:Event calendar item you can see how a switch function is used to add additional annotations to a subject that depends on the input of the Form:Event calendar item. It should be possible for you to make similar adjustments to achieve your "hidden" property = category assignment (data input post-processing).

In case you want to make some form field to be pre-selected/pre-filled based on some input dependency from another field, you better ask for assistance on SF talk page (this has less to do with SMW in relation on how data are represented or stored).

MWJames (talk)02:20, 7 April 2015

So there is not actually a direct way of representing "graph" type data, but just individuals with properties, right? Well, we can have something like "graphs" with "subclassOf", but not having pointers from a category to other.


So if i do have 3 categories, department (which includes subjects), teacher (which teaches subjects) and subjects, if i added subjects to department and teacher, i would still not see nothing in "subjects" category.


I understand that properties and categories should be differenced, but i am pretty much surprised there is no way of making a form or template which instead of properties, can use categories as information source.

Something that gives me hope, it that semantic forms has 2 options for it´s properties which are "category" and "categories", so perhaps someone has been trying to solve this issue.

Unluckily the only thing which this does to your form is writting a box with "name" which you can not even fill, so perhaps it was forgotten.


What is that SF talk?


P.D: I would be more direct with this question. "How can we use categories, instead of properties in forms or templates?".

Maiser (talk)17:58, 7 April 2015

> So there is not actually a direct way of representing "graph" type data, but just individuals with properties, right? Well, we can have something like "graphs" with "subclassOf", but not having pointers from a category to other.

We need to clarify the use of the term "graph" in relation to SMW, OWL and machine-readable descriptions such as RDF.

When you create an article (a subject, the source of a collection of facts about that subject) together with a property-value or class (a category) annotation you express a graph that says "my subject contains an attribute (the property) with an value of ..." or "the subject belongs to a class of ... (a category)". So when editing/creating/annotating an article you declare a "graph" that can be encoded into an equivalent representation such as RDF (for more see Help:RDF export.

> So if i do have 3 categories, department (which includes subjects), teacher (which teaches subjects) and subjects, if i added subjects to department and teacher, i would still not see nothing in "subjects" category.

I'm not clear about what you mean by "still not see nothing". If you query for the relation you should be able to see those which belong to either category. A declaration such as "subclassOf" is automatically resolved (see also category hierarchy, Help:$smwgUseCategoryHierarchy). Relationships will not appear automatically on an article (this is where you have to employ queries to make them visible, see also Help:Inverse properties and Help:Inferencing).

> I understand that properties and categories should be differenced, but i am pretty much surprised there is no way of making a form or template which instead of properties, can use categories as information source.

This is not what I have said. You are free to use both categories or properties as first class citizen. I merely emphasized that input and post-processing need to be detached from each other and that a category and a property are to represent a different statement about an object (also in regards as to how it is encoded in RDF).

> Unluckily the only thing which this does to your form is writing a box with "name" which you can not even fill, so perhaps it was forgotten.

This was an example and was to demonstrate the difference between form and template usage/editing processing.

> Something that gives me hope, it that semantic forms has 2 options for it´s properties which are "category" and "categories", so perhaps someone has been trying to solve this issue.

I don't use SF therefore I can't make any comments on that.

> What is that SF talk?

See, SF.

MWJames (talk)19:00, 7 April 2015
 
 
 
 
 

Semantic Forms

Hello there,

i was looking forward a way to do this:

I create a form using "semantic forms" extensions,and category which uses this form both for example called "department". Whenever i create a department using this form, it does not add it in the "department" category and i would like to know how can we do this.

Is there any way to add some text to the "free text" side of the form? Perhaps i could add the "" in there so that all created departments are automatically included in there.

Maiser (talk)07:52, 6 April 2015

Ok, i have been checking about it, and SEEMS the way i was trying it, was correct. Anyway, it does not show up instantly (will wait a couple of hours and see).

Actually the way is:

A template can be used to add pages to a category, usually by placing the category link inside tags on the template (e.g. ). When the template is transcluded into the page, the category link becomes active, and the page is added to the category page. This is useful for categories that have high turnover or many pages included, like cleanup categories.


From

http://en.wikipedia.org/wiki/Help:Category


Perhaps someone knows another way to perform an "instant" categorization? This is kind of the indirect way, and seems it needs a lot of time to "oficially" enter the category.

Maiser (talk)08:18, 6 April 2015

Lol! I was mistaking template with forms. Seems it works when you edit the template, and i was working with forms.

Maiser (talk)08:30, 6 April 2015
 
 

Hide subcategories in Special:Category main menu

Hey,


imagine i want to define a something like this:


Category1

Category2

Category3


Catogory 2 is subcategory of Category1, and 3 is subcategory of 2.

So in a tree, it would be like Category1->Category2->Category3


Problema is that in Special:Category i will see

Category1(3)

Category2(2)

Category3(1)

Showing me all categories with the number of subcategories+1.

How could i maintain a tree view, making only (at this point) Category1 the only visible from the Special:category menu?

Maiser (talk)16:56, 25 March 2015

> How could i maintain a tree view, making only (at this point) Category1 the only visible from the Special:category menu?

Generally, SMW (core) does not alter (or interferes with) the display of standard MediaWiki objects (such as categories). I'm not aware of any extension that would fit your requirement but maybe [0] can give you a starting point.

[0] https://www.mediawiki.org/w/index.php?search=category+tree&title=Special%3ASearch&go=Go

MWJames (talk)19:58, 25 March 2015

Yes, at the end i felt charmed for category tree extension, which is the most similar tool that exists to fulfill this request,

Thanks for your time.

Maiser (talk)14:09, 2 April 2015
 
 

SMW database error

Hi,

We are using the older 1.8.0.5 version of SMW with MediaWiki 1.20.2, PHP 5.4.9, MySQL 5.5.28. Everything has been working great so far and we are well over 106,000 pages in our system after over 2 years or use in production. Recently we encountered the following database error when running jobs. It seems to occur only a specific type of page invoking a specific template.

A database query syntax error has occurred. The last attempted database query was: "INSERT IGNORE INTO `t6` SELECT t7.smw_id FROM `smw_object_ids` AS t7 WHERE t7.smw_sortkey LIKE 'CID%'" from within function "SMW::executeQueries". Database returned error "1114: The table 't6' is full (localhost)"

Is this related to some default MySQL setting for SMW? We currently have just over 16GB RAM used for MySQL caching and buffers. We have plenty of hard disk space. I'm wondering if there is some simple MySQL setting we need to change to increase teh table size. Any help here would appreciated.

Thanks,

Lloonngg (talk) 14:29, 24 March 2015 (CET)

Lloonngg (talk)15:29, 24 March 2015

> We are using the older 1.8.0.5 version of SMW with MediaWiki 1.20.2, PHP 5.4.9, MySQL 5.5.28.

Honestly it will be difficult for use to make any suggestions since you are using a no longer maintained code base (SMW 1.8*). It will be toilsome for us to make an appropriate response but we are tracking the issue at [0].

> It seems to occur only a specific type of page invoking a specific template.

Is it possible for you to post the details of your analysis to [0]?

Also, could you try running an isolated stack trace to see whether the queries are caught in a resource loop and link the report to [0]. Limit your pages when running the job because "$wgDebugDumpSql = true" is expensive as it returns each single SQL query executed.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/918

MWJames (talk)17:23, 24 March 2015

See the post to error 1114 at [0].

MWJames (talk)17:38, 24 March 2015
 
 

Declaring subcategory without entering the category page

Hello,


at the moment i have to bring a pretty big class hierarchy from a .owl document to my SMW. I have been searching for quite a long time on how to do this, but i have seen that there is no way of a direct "import.

In order to do this, my idea is creating a document which makes something like this:


//Category declaration . . . .


This is easy, and will allow me to create all categories, problem is that they need to be organized in a hierarchy.

For this i would need something like


catego1 subCategoryOf: catego2

You know, without having to enter the category (in this example catego1) each time, as there is a pretty long way to go.

Any clue on how to do this? Did not found nothing on how to do that.

Maiser (talk)18:31, 23 March 2015

Some questions about SMW

Hello all,

at the moment i am becoming crazy looking for information about different aspects of the SMW, and would be cool if someone could help me with them.

1) How can i import ontologies into my SMW? I want to import DublinCore one and another one which i have in ".owl" format, is there any way?

 With import i mean having the possibility to use the vocabulary itself on my forms, i would like to have categories and properties automatically created from these ones.
 
 I know there is a way of making a property which is "equal" to external ontologies vocabulary this way:
 https://semantic-mediawiki.org/wiki/Help:Import_vocabulary#Making_vocabularies_available_for_import
 
 But this is not what i am looking for. I just want to click "properties"for example and have vocabulary there.


2) Hide deleted properties, categories.......

 Whenever i go to my properties place, i find thousands of them with the yellow "warning" sign, which makes you know they have been deleted. I simply want to hide them so they do not botter me when i want to 
 see the actual vocabulary.


Well, this is all for the moment.

Thanks.

Maiser (talk)17:38, 18 March 2015

> With import i mean having the possibility to use the vocabulary itself on my forms, i would like to have categories and properties automatically created from these ones.

Forms and imported vocabularies don't share any commonalities or functionality. SMW is used under the premise of explicit type declarations. Of course you can create ad-hoc properties but those are defaulted to the page type and should be adjusted to a type it is ought to represent.

As for imported property references (e.g. foaf, dc), the following discussions should give you a quick overview of what is supported and how [0, 1].

> I just want to click "properties"for example and have vocabulary there.

I'm not sure I understand the comment.

> Whenever i go to my properties place, i find thousands of them with the yellow "warning" sign, which makes you know they have been deleted.

Again, I'm not sure I understand the comment/question. Do you mean by "properties place" the Special:Properties page? In case you mean Special:Properties, see Help:$smwgPropertyZeroCountDisplay.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/891

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/464#issuecomment-70341109

MWJames (talk)18:21, 18 March 2015

I will put an example of what i mean with import:

FOAF has:

Classes:

Agent | Document | Group | Image | LabelProperty | OnlineAccount | OnlineChatAccount | OnlineEcommerceAccount | OnlineGamingAccount | Organization | Person | PersonalProfileDocument | Project |

Properties:

account | accountName | accountServiceHomepage | age | aimChatID | based_near | birthday | currentProject | depiction | depicts | dnaChecksum | familyName | family_name | firstName | focus | fundedBy | geekcode | gender | givenName | givenname | holdsAccount | homepage | icqChatID | img | interest | isPrimaryTopicOf | jabberID | knows | lastName | logo | made | maker | mbox | mbox_sha1sum | member | membershipClass | msnChatID | myersBriggs | name | nick | openid | page | pastProject | phone | plan | primaryTopic | publications | schoolHomepage | sha1 | skypeID | status | surname | theme | thumbnail | tipjar | title | topic | topic_interest | weblog | workInfoHomepage | workplaceHomepage | yahooChatID |


According to : http://xmlns.com/foaf/spec/

I need a way to import classes and properties into my web, so that i go into "Special:properties" and see the foaf classes as if they were introduced by hand in the web. Same with properties, when i go to "Special:properties".

Is it a bit clearer now?


I tried to follow the import marked on :

https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/464#issuecomment-70341109

But this did not do the thing for me.



Issue 2:

Even if this was not what i was looking for:

Help:$smwgPropertyZeroCountDisplay.

Thanks! It will help me. I just wanted to hide properties which had been deleted, not those with 0 uses :).

Hope you can help me with imports now. Thanks for your time!

Maiser (talk)14:57, 19 March 2015

Issue 1: As the documentation says, after creating the page for the vocabulary import (MediaWiki:Smw import foaf, for example), you have to include (manually or via template/transclusion) [[imported from::foaf:knows]] statement in a property page or in a category page (if it is a class).

Issue 2: I don't have an answer for this. I have the same problem for years.

Jaider msg23:11, 19 March 2015

Issue 1: I already mentioned i did that, but that was not what i was looking for! I am looking for a way to automatically import all vocabulary into the web, without the need to create things one by one each time.

Maiser (talk)00:55, 20 March 2015

> for a way to automatically import all vocabulary

A semi-automatic approach is being described above by [1].

> without the need to create things one by one each time.

As I mentioned earlier "SMW is used under the premise of explicit type declarations." which means you need at least to declare a connection between a property (Property:A) and its external representation (imported from::foaf:name) otherwise how should the system (SMW) know the attributive connection between an internal and external term.

To import something without making an explicit declaration is not how SMW ought to work. One can write a tool that would help with those assignments but since each wiki uses individual named properties to assign values, it can not be assumed that Property:Foaf:name on wiki-A means (in terms of its entity description) the same thing as Property:Foaf:name on wiki-B (even though the common sense would dictate such conjecture) because those assumption are not declarative.

SMW does not reserve the foaf/dc (or any other) namespace for exclusive use by an external vocabulary making it therefore not feasible to assume that Property:Foaf:name represents an external foaf:name entity (this is where we use imported from to assign the meaning of an external vocabulary to a property of one's own choosing).

> things one by one each time.

You only create a declaration once per property.

MWJames (talk)01:31, 20 March 2015
 
 
 
 
 

Semantic Issue After upgrade

Mediawiki upgraded from 1.12 to Mediawiki 1.21

SMW 1.8.0

Hi ,


for ex i created one autopopulated page by using the below syntaxt



like this i have multiple queries on multiple pages, after upgrade of mediawiki 1.12 to mediawiki 1.21 one extra column is coming for ex


  Name of the Document
<a href="Test1" title="Test1">Test1</a> <a href="Test1" title="Test1">Test1</a>

the first <th> adding all ask query page it is showing all the second column value

how to fix it?

Rajeshrjsh (talk)14:38, 17 March 2015

Do not do crossposting please! Things will not get faster doing so, in contrary. See the thread on the mailing list

[[kgh]] (talk)20:21, 17 March 2015
 
First page
First page
Previous page
Previous page
Last page
Last page