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

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
 

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
 

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
 
 

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
 

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
 
 
 
 
 

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

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
 

Templates not enabled for semantic in-text annotations due to namespace restrictions.

We just installed SMW Bundle 2.1 and the templates are not enabled, whereas the form pages are. I'm just the content person, not the one that did the install. Can anyone point me to the config parameter?

Dlacy (talk)22:38, 20 February 2015

$smwgNamespacesWithSemanticLinks is the setting that has to be changed by the system administrators.

[[kgh]] (talk)23:12, 22 February 2015
 

Semantic Forms and Parameters

Hi,

I have installed Semantic Media Wiki (last version) on a local machine. To creat forms, attributes etc. I installed the extension Semantic Forms. Everything is working so far, only the options for the parameters to edit the values etc. don't show up.

Screenshot: http://imgur.com/czpDJSj

Can anyone help?

Best, Matthias

Gosso (talk)18:56, 6 February 2015

I believe you will be better of asking at the Semantic Forms support page. Do not forget to mention your setup, e.g. version of MW, SF, PHP etc.

[[kgh]] (talk)19:24, 6 February 2015
 

SMW Page Lists

Good day:

I have been experimenting with with sub-objects and queries hoping to find a programmatic way to generate lists of related articles based on property values.

I see there are three extensions called Dynamic Page List that do this. I have the strong impression that none of them do so based on Semantic MediaWiki properties.

Can anyone suggest a path I might follow to create the lists I desire?

Thank you

AKSHA (talk)02:10, 9 November 2014

I would use SMW to do this instead of installing DPL.

[[kgh]] (talk)19:22, 6 February 2015
 

Semantic Internal Objects to Headings

Good day:

I would like to use queries to concatenate a string that includes property values so that these can function as article headings something like the following.

==={{#ask:[[Name::+]] [[NameFirst::Bruce]] [[NameLast::Wayne]] |? NameFirst }} {{#ask:[[Name::+]] [[NameFirst::Bruce]] [[NameLast::Wayne]] |? NameLast }}===

I have managed the following.

{{#set_internal:Name |[[NameFirst::]]= |[[NameLast::]]= }}

I have created the above object on a template page. I assume I have done this incorrectly, which may be my problem. I have put data into several articles to test my syntax.

  • Bruce Wayne
  • Bruce Banner
  • Peter Parker
  • Kevin Matchstick
  • Clark Kent

I then query the data successfully with the query below.

{{#ask:[[Name::+]] |? NameFirst |? NameLast }}

My problem so far is that I cannot get a query to produce plain text like: Bruce

How can I achieve this?

Thank you AKSHA

AKSHA (talk)01:37, 7 November 2014

Try {{#show: Bruce Wayne | NameFirst}}.

Alexander Mashintalk03:55, 7 November 2014

Thanks for that very good advice. The following provided the desired output: "Peter"

{{#show:[[Name::+]] [[NameFirst::Peter]] |?NameFirst }}

The following provided the output: "Bruce Bruce".

{{#show:[[Name::+]] [[NameFirst::Bruce]] |?NameFirst }}

This confused me until I realized that my data include: Bruce Wayne Bruce Banner

Thank you, thank you.

Have you any sense why both results come with the following error message?

Error

  • Some part ".." of the query was not understood.
  • The symbol "[[" was used in a place where it is not useful.
  • The part "]]" of the query was not understood. Result might not be as expected.
AKSHA (talk)05:19, 7 November 2014

{{#show:}} shows a property of only one page. It's {{#show:Bruce Wayne | ?NameFirst}}, not {{#show:[[NameFirst::Bruce Wayne]] [[Name::+]] | ?NameFirst}}. I'm surprised it worked at all. If you need more complex query conditions than page name, use {{#ask:[[NameFirst::Bruce Wayne]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = - | headers = hide}}

Alexander Mashintalk09:01, 7 November 2014

I put in the following ask and get no output:

{{#ask:[[NameFirst::Bruce Wayne]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = - | headers = hide}}


I think this is because no property value corresponds to “Bruce Wayne” so I change [[NameFirst::Bruce Wayne]] to [[NameFirst::Bruce]]:

{{#ask:[[NameFirst::Bruce]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = - | headers = hide}}


This returns: Bruce-. I want to get rid of that “-” so I experimentally remove a “-” from the query and view the page without it. This makes for an unwanted output so I edit the query and repair what I broke. Then I try deleting another “-”. This testing proves that if I remove the “-” from “searchlabel”, I get a pure property value: Bruce

{{#ask:[[NameFirst::Bruce]] [[Name::+]] | ?NameFirst#- | format = list | mainlabel=- | limit=1 | searchlabel = | headers = hide}}


Lessons learned[edit]

In an #ask the first parameters are the object you are querying and the property value you are searching for. They come before the first pipe “|”. Otherwise, place order is not a factor so the following are equivalent:

  • {{#ask:[[NameFirst::Bruce]] [[Name::+]] | }}
  • {{#ask:[[Name::+]] [[NameFirst::Bruce]] | }}


Many formatting instructions can apply to a single query as long as no two contradict. Each must be separated by a pipe “|”.


This solution provides a fine grained example of how to provide multiple formatting instructions to a query. It also provides a working example so that an inexperienced user can make individual changes and see the result. This helps a new user get over a number of very basic mistakes. By new user I mean myself.

Thank you for walking me through this solution Alexander Mashin.

Equipped with this example, I feel confident of making a better class of mistakes.

AKSHA (talk)17:44, 7 November 2014
 
 
 
 

ORCID user template

I have created Template:User ORCID, for those of you who have registered for an ORCID identifier. You can see an example on my user page. Please feel free to use it on your user page, or to port it to your own wiki. Pigsonthewing (talk) 01:39, 20 September 2014 (CEST)

Pigsonthewing (talk)01:39, 20 September 2014

I am still undecided if this is acceptable on this wiki. Nothing against providing such information on the user page, but I guess on some wikis a plain link instead of an extra template does the same goodness. Let's see how you future involvement looks like on this wiki. Cheers

[[kgh]] (talk)12:51, 20 September 2014
 

Conditional formatting according to properties

Hello, (this question was first raised in the wrong place here):

Is there a simple way of adding conditional formatting to a template that gets filled with a form and annotated properties? Let's say, there is a property:has Priority, and priority A should color the section red, B orange, C yellow… and so on. I've searched and tried a lot, but only found info about conditional formatting for tables.

Goal is to let the user choose an option within a form (+ template) and according to the answer display a certain formatting.

I guess, it's not going to work with the #if parser function, instead I've tried to use #switch like this:

<div style="background-color:#{{#switch:{{{Priority}}}
|#A = faa8a8
|B = facba8
|C = faf1a8
|#default = e1e4e2}};">
…
</div>

It's not reacting at all, if within <span> tags, but gives out the value of #default, when within <div> tags. (I fear I might have totally misunderstood the concept here?)

MediaWiki uses something like this in the Extension template, but it's hard to make out the relevant parts...

I would be happy about any hints pointing me in the right direction.

Zabien (talk)14:45, 18 September 2014

Demos not working

Hi, I was searching for some result formats and I think some of them are broken or misconfigured, see:

Jaider Msg21:52, 2 January 2014

Thanks for reporting. I filed an issue about the fatal errors here https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/67

Jeroen De Dauw (talk)01:39, 3 January 2014

Fatal errors have been fixed.

Jeroen De Dauw (talk)01:56, 3 January 2014
 

The Slideshow format is not working again, see the "Result:" section, after "Example".

Jaider msg00:18, 11 August 2014

It is a known issue [0] but someone has to pick-up the task.

[0] https://github.com/SemanticMediaWiki/SemanticResultFormats/issues/56

MWJames (talk)00:27, 11 August 2014
 
 

Schema _> form for uploading or referencing video plus fields for annotation

Hi All, I am a total noob- although I bought Yaron's book and have been feverishly trying to get the site up. I have the current SMW bundle running and am trying to create a form for uploading a video, then making a few notes, mostly text, a couple boolean, etc. I'd like to be able to edit the fields later (and also the form, that's why I thought schema would be the way to go...) I can't seem to get past the video part though. Is it possible to upload via a form? Would I be better off just uploading the videos separately, then embedding them?

This is for a school research project on gesture analysis and my professor is expecting a presentation on Weds. So, I'm stressing a bit :) Any advise appreciated. I even have a minuscule research budget if someone wants to make $60

Thanks!

Ikesmith (talk)19:22, 8 August 2014

Hi - I hope the book is useful! And yes, Page Schemas is the way to go. Support for displaying videos is pretty primitive, but yes, if you have a way to embed uploaded video files (via the Widgets extension, ideally), then you can upload them via the form - it's just a matter of editing the template to display the video file in the right way, which you would have to do by hand.

Yaron Koren (talk)19:42, 8 August 2014
 

"sort" option in query does not include results that have no value in sorted field

Edited by another user.
Last edit: 22:23, 4 March 2014

Hello,

The following query brings up no results (because Begin Date is blank):

{{#ask:[[Category:Market research]]
|?ResearchStatus
|?ResearchType
|?Description
|sort=BeginDate
}}

But this query brings up all results:

{{#ask:[[Category:Market research]]
|?ResearchStatus
|?ResearchType
|?Description
}}

I don't think that it logically follows that a "sort" option should exclude results where sorted field is blank.

Patelmm79 (talk)22:00, 4 March 2014

Well, if you do not query for a property you cannot sort by it since your printout statement cannot be fulfilled. Somehow you have to pick up the date from the pages/subobjects with the query. See sorting results. So your query should be

{{#ask:[[Category:Market research]]
|?ResearchStatus
|?ResearchType
|?Description
|?BeginDate
|sort=BeginDate
}}
[[kgh]] (talk)22:29, 4 March 2014

This is about sort statements that filter out the rows in which the sorted field is null, I think. An old and already reported problem of SMW.

Alexander Mashintalk03:42, 5 March 2014
 

A simple workaround to this is to define, in the template, some default values for the properties of interest if they are not already set. ie:

{{#if: {{{ArgIwant|}}}||[[PropIneed::SomeDefaultValue]]}} 

It's more elegant to do it where it's actually printing, but this has overcome the whole 'sort' issue any time I've needed it. Though, it assumes all the articles call some templates to which you could do this.

Lbillett (talk)04:56, 6 July 2014
 
First page
First page
Previous page
Previous page
Last page
Last page