SMW notes: Difference between revisions

From zooid Wiki
Jump to navigation Jump to search
Line 1: Line 1:
Some tips and tricks for using Semantic Mediawiki from SMW mailing list, various web sites, etc.
'''Type''': Resolution


== Other tip sources ==
'''Status''': Adopted on 7/19/04  In Favor - 6  Opposed - 2


http://smwforum.ontoprise.com/smwforum/images/a/ad/Manual_SMW.pdf
'''Source File''': http://www.ala.org/ala/oif/ifissues/pasadena.pdf


http://smw.referata.com/wiki/Special:BrowseData/Tips
'''Text''':


http://smwforum.ontoprise.com/smwforum/index.php/Example:All_libraries
'''RESOLUTION NO. 8378'''<br>
A RESOLUTION OF THE CITY COUNCIL OF THE CITY OF PASADENA, CALIFORNIA SUPPORTING THE PROTECTION OF CIVIL LIBERTIES AND OPPOSING CERTAIN PROVISIONS OF THE USA PATRIOT ACT


http://help.wikia.com/wiki/Help:Semantic_MediaWiki/Tips_and_tricks
'''WHEREAS''', the City of Pasadena denounces terrorism, and expresses its gratitude to and support for those who defend us from terrorism and terrorist attacks - the men and women serving in our armed forces, federal, state and local law enforcement officers, firefighters, and health services professionals; and


http://semantic-mediawiki.org/wiki/Image:SMW_quick_reference.pdf
'''WHEREAS''' the City of Pasadena is proud of its commitment to protecting civil rights and
liberties as expressed in both the Constitution of the United States, and the Constitution of the State of California which so many have made grave sacrifices to protect, and which have been preserved only through constant vigilance and by public outcry when threats have arisen, and


http://www.organicdesign.co.nz/MediaWiki_code_snippets (mediawiki)
'''WHEREAS''' the preservation of those civil rights and liberties is not only essential to the
well-being of a democratic society, but is an intrinsic defining characteristic of our free and democratic nation; and


== Data design ==
'''WHEREAS''', it is the responsibility of the City of Pasadena to protect the rights and liberties of
our citizens; and


http://www.mediawiki.org/wiki/Extension:Semantic_Forms#Data_design_issues
'''WHEREAS''', the City of Pasadena recognizes that an infringement of the constitutionally guaranteed rights of any person is a breach of the public trust, and a violation of civil rights; and


- Create a top category for Semantic Classes. I called mine 'Categories'.
'''WHEREAS''', the USA Patriot Act (acronym for "Uniting and Strengthening America by Providing Appropriate Tools Required to Intercept and Obstruct Terrorism") passed quickly in the wake of the horrific September 11th terrorist attacks against our country and was signed into law by President George W. Bush on October 26, 2001; and
It holds only categories used to define a 'Is-a' relationship. Doing so has
at least two benefits : 1- You can do a query on your core content by
restricting it to the 'Categories' level. 2- You can define other
categories outside of that structure for whatever your system needs.


http://smwforum.ontoprise.com/smwforum/index.php/Example:How_to_realize_a_range_constraint_for_a_property
'''WHEREAS''', the enactment of the Patriot Act has since given new, far-reaching powers to both
domestic law enforcement and international intelligence agencies while simultaneously hampering the
oversight ability of the courts to ensure that these powers will not be abused; and


Redirects can be used to create property synonyms.
'''WHEREAS''' certain provisions of the USA Patriot Act and related executive orders, regulations
and actions adopted since September 11, 2001 threaten fundamental rights and liberties by:


== Discussion ==
(A) Authorizing the indefinite incarceration of non-citizens based on mere suspicion, and the indefinite incarceration of citizens designated by the President as enemy combatants without access to counsel or meaningful recourse to the federal courts;


Categories can be hierarchical; properties can't (yet).
(B) Limiting the traditional authority of federal courts to curb law enforcement abuse of electronic
surveillance in anti-terrorism investigations and ordinary criminal investigations;


When to use categories vs properties?
(C) Expanding the authority of federal agents to conduct so-called sneak and peek searches, in which the subject of the search warrant is unaware that his property has been searched;


== MW tricks ==
(D) Granting law enforcement and intelligence agencies broad access to personal medical, financial,
library and education records with little, if any, judicial oversight;


If you want to clear out old pages you can delete them and use
(E) Potentially chilling constitutionally protected speech through possibly overbroad definitions of
deleteArchivedRevisions.php to erase the deleted revisions from the
terrorism;
database.


=== Variables ===
(F) Permitting federal agents to conduct broad surveillance of religious services, political
demonstrations, and other public meetings of any kind without having any evidence that a crime has
been or may be committed; and


You can make use of the VariablesExtension [1] and store the query (or its
'''WHEREAS''' new legislation drafted by the Administration contains provisions related to law
result? I'd like to know which one, but in the end it doesn't really matter) in
enforcement and intelligence gathering powers that could further dilute, suspend, or repress many of our basic constitutional rights, and further disturb our unique system of checks and balances.
a variable, which is helpful when you need the same query multiple times within
a page. It looks like this:


<nowiki>{{ #vardefine: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }}
'''NOW THEREFORE, BE IT RESOLVED''' that the City of Pasadena opposes certain provisions in the USA PATRIOT Act (Public Law 107-56) and related executive orders, regulations, and actions which threaten fundamental rights and liberties guaranteed under the United States Constitution.
(silent) or
{{ #vardefineecho: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} (with output)</nowiki>


Further down in the page you can write
'''IT IS FURTHER RESOLVED''' that the City of Pasadena:


<nowiki>{{ #var: some_variable_name }}</nowiki>
(A) Supports legislation to repeal provisions in the USA Patriot Act and related Executive Orders that
violate the Constitution of the United States and the civil rights and civil liberties of individuals;


=== Specific searches ===
(B) Opposes any legislative or administrative action that would strengthen government's ability to violate individual privacy and civil rights;


  <nowiki>
(C) Specifically opposes Section 215 and Section 216 of the USA Patriot Act and any other legislation
  <inputbox>
or administrative action which unduly requires libraries to violate the privacy rights of patrons by
  type=search
monitoring, reporting, and /or disclosing their borrowing practices or library use history beyond what is required by California Law.
  width=30
  namespaces=Help**,Wikipedia**,Template**
  searchbuttonlabel=Search help pages
  bgcolor=#cee0f2
  break=no
  </inputbox>
  </nowiki>


(requires the Input Box extension)
(D) Opposes military detention, secret detention, secret immigration proceedings, or detention without
access to counsel, of individuals within the City of Pasadena;


=== Profiling mediawiki ===
(E) Opposes the surveillance of individuals or groups of individuals based on their participation in
activities protected by the First Amendment, such as political advocacy or the practice of a religion,
without reasonable suspicion of potential criminal activity; and


http://www.mediawiki.org/wiki/How_to_debug#Profiling
'''IT IS FURTHER RESOLVED''' that the Pasadena City Council directs the Mayor to:


=== Mediawiki performance tuning ===
(A) Transmit a copy of this Resolution to Senators Diane Feinstein and Barbara Boxer and to
Representative Adam Schiff accompanied by a letter urging them to:


http://www.mediawiki.org/wiki/Manual:Performance_tuning
(1) Monitor federal anti-terrorism tactics and work to repeal provisions of the USA Patriot Act and
other laws, regulations, and executive actions that infringe on civil rights and liberties as described in this Resolution;<br>
(2) Take all possible actions to lead Congressional action to prohibit passage of further laws
abridging civil liberties;<br>
(3) Ensure that the sunset date of Title III of the Act remains in force and is honored;<br>
(4) Support the proposed Freedom to Read Protection Act, the Patriot Act Oversight Restoration Act, and other current and future legislation consistent with this Resolution; and


* APC can be used with SMW without problems
(B) Transmit a copy of this Resolution to Governor Arnold Schwarzenegger, and appropriate members of the State Legislature, accompanied by a letter urging them to ensure that state anti-terrorism laws and policies be implemented in a manner that does not infringe on civil liberties as described in this
Resolution; and


== SMW tricks ==
(C) Transmit a copy of this Resolution to President George W. Bush and United States Attorney
 
General John Ashcroft.
<nowiki>[[Went past deadline::{{#expr:{{{End date|}}}>{{{Deadline|}}} }}]]</nowiki>
 
=== Hiding set data ===
 
  <nowiki>[[propertyA::{{{propertyA|}}}|]]</nowiki>
 
By adding the | after the enclosing }}}, the property value will not show.
 
For multi value properties:
 
  <nowiki>{{#arraymap:{{{Eating disorders behaviors|}}}|,|x|[[Eating disorders behaviors::x|]]}}</nowiki>
 
(why not just use #set?)
 
=== Protecting #ask results ===
 
(from Markus Kr?tzsch)
 
* make a new property "has checked" of type page,
* make and a new page "main page news editor" (or whatever) and protect this page just like your main page,
* add an entry <nowiki>[[has checked::some page]]</nowiki> on "main page news editor" for every page that the editor has found to be okay to make it on the main page news feed,
* extend your #ask query on the main page with the condition <nowiki>[[-has
checked::main page news editor]]</nowiki>.
 
... Note that you can also have a group of editors with separate (protected)
pages. You can also work with categories of editors for different topics etc.
Of course, this is no longer a spam protection since categories are not
protected either, but you can use another level of "has checked" to have a
master editor who checks other editors to grant them trust. All of this
readily works with subqueries+inverses. Applying similar methods but without
actually protecting any pages maybe still be useful for managing feeds
together in cases where spam is not a major issue.
 
== Misc ==
 
=== Enable links in property values ===
 
$smwgLinksInValues = true;
 
=== Must add namespaces to config ===
 
Otherwise they won't have semantic properties.
 
$smwgNamespacesWithSemanticLinks array
 
== Multi language SMW ==
 
=== Creationwiki ===
 
(From Temlakos on the mailing list regarding http://creationwiki.org/ and http://creationwiki.org/fr/)
 
Here's how I do it: As I have said many times before, I routinely
declare all properties. And every declaration that is implemented in
both languages, has the language-specific Interwiki prefix added, so
that you can follow a property declaration from one language to the
other and back.
 
All that is involved is making parallel property declarations and
placing Interwiki language links in each one.
 
In general: a multilingual wiki is actually a family of wikis, each set
up in its own language.
 
The important part is to make sure that the SMW language files exist in
each language in which you are planning to implement SMW. Right now the
language support is a little thin, in comparison to the incredible
multiplicity of languages on Wikipedia. So those of you who are trying
to persuade Wikipedia to implement SMW across their project will have an
immediate problem: you don't support more than a handful of the
languages they use.
 
...
anyone who implements SMW in an unsupported language is going to have to
write a language file. And make sure that his language is supported in
SMW_Aliases.php and SMW_Messages.php.
 
=== HKp wiki ===
 
'HKp wiki' is  a bilingual (potentially multilingual) spanish-catalan
wiki in the same installation.
http://enlloc.net/hkp/w
 
I'm using Polyglot extension [1] to redirect to appropriate language
pages depending on the browser language settings or the user wiki
settings.
 
I'm using Language Selector extension for providing a language
selector for every page in the sidebar.
 
I wanted to use the Multilang extension for changing the language in
pages and forms depending on the user settings. But unfortunately this
extension don't work in MW higher of 1.10.
 
Alternatively I'm using the [http://enlloc.net/hkp/w/index.php/Plantilla:International <nowiki>{{international}}nowiki> template]. It is useful
for pages and templates but not for forms because it need a
<nowiki>{{SUBPAGENAME}}</nowiki> with language code (/ca, /es, /en, /fr, /pt, ...).
 
I'm using [http://enlloc.net/hkp/w/index.php/Plantilla:Entrada_Wlog my own code in templates] to show or hide a "translation
button" depending if the translation page exist or not:
 
  <nowiki>{{#ifeq:{{SUBPAGENAME}}|es|
{{exists | page={{NAMESPACE}}:{{BASEPAGENAME}}/ca | then= | else=
<p style="margin-top:2em; color: rgb(100, 100, 100)">'''Traducci?n'''<br>[[Categoria:Per traduir al Castell?]]
<small>Esta p?gina a?n no est? en catal?n. Quieres colaborar a traducirla?</small></p>
{{#formlink:Entrada Wlog traduir ca|Traducir al catal?n|button|
preload={{FULLPAGENAME}}&Gesti? traduccions[p?gina
original]={{BASEPAGENAME}}&Entrada Wlog[llengua entrada]=es&namespace=Wlog }}
}}
}}</nowiki>
 
Right now I have not solution for having only one form for all
languages. What is annoying.
 
== Media ==
 
Neat talk on MW, with refs to SMW: http://www.youtube.com/watch?v=Ukytqe9pwDM
 
[[Category:SemWeb]]

Revision as of 16:33, 13 October 2009

Type: Resolution

Status: Adopted on 7/19/04 In Favor - 6 Opposed - 2

Source File: http://www.ala.org/ala/oif/ifissues/pasadena.pdf

Text:

RESOLUTION NO. 8378
A RESOLUTION OF THE CITY COUNCIL OF THE CITY OF PASADENA, CALIFORNIA SUPPORTING THE PROTECTION OF CIVIL LIBERTIES AND OPPOSING CERTAIN PROVISIONS OF THE USA PATRIOT ACT

WHEREAS, the City of Pasadena denounces terrorism, and expresses its gratitude to and support for those who defend us from terrorism and terrorist attacks - the men and women serving in our armed forces, federal, state and local law enforcement officers, firefighters, and health services professionals; and

WHEREAS the City of Pasadena is proud of its commitment to protecting civil rights and liberties as expressed in both the Constitution of the United States, and the Constitution of the State of California which so many have made grave sacrifices to protect, and which have been preserved only through constant vigilance and by public outcry when threats have arisen, and

WHEREAS the preservation of those civil rights and liberties is not only essential to the well-being of a democratic society, but is an intrinsic defining characteristic of our free and democratic nation; and

WHEREAS, it is the responsibility of the City of Pasadena to protect the rights and liberties of our citizens; and

WHEREAS, the City of Pasadena recognizes that an infringement of the constitutionally guaranteed rights of any person is a breach of the public trust, and a violation of civil rights; and

WHEREAS, the USA Patriot Act (acronym for "Uniting and Strengthening America by Providing Appropriate Tools Required to Intercept and Obstruct Terrorism") passed quickly in the wake of the horrific September 11th terrorist attacks against our country and was signed into law by President George W. Bush on October 26, 2001; and

WHEREAS, the enactment of the Patriot Act has since given new, far-reaching powers to both domestic law enforcement and international intelligence agencies while simultaneously hampering the oversight ability of the courts to ensure that these powers will not be abused; and

WHEREAS certain provisions of the USA Patriot Act and related executive orders, regulations and actions adopted since September 11, 2001 threaten fundamental rights and liberties by:

(A) Authorizing the indefinite incarceration of non-citizens based on mere suspicion, and the indefinite incarceration of citizens designated by the President as enemy combatants without access to counsel or meaningful recourse to the federal courts;

(B) Limiting the traditional authority of federal courts to curb law enforcement abuse of electronic surveillance in anti-terrorism investigations and ordinary criminal investigations;

(C) Expanding the authority of federal agents to conduct so-called sneak and peek searches, in which the subject of the search warrant is unaware that his property has been searched;

(D) Granting law enforcement and intelligence agencies broad access to personal medical, financial, library and education records with little, if any, judicial oversight;

(E) Potentially chilling constitutionally protected speech through possibly overbroad definitions of terrorism;

(F) Permitting federal agents to conduct broad surveillance of religious services, political demonstrations, and other public meetings of any kind without having any evidence that a crime has been or may be committed; and

WHEREAS new legislation drafted by the Administration contains provisions related to law enforcement and intelligence gathering powers that could further dilute, suspend, or repress many of our basic constitutional rights, and further disturb our unique system of checks and balances.

NOW THEREFORE, BE IT RESOLVED that the City of Pasadena opposes certain provisions in the USA PATRIOT Act (Public Law 107-56) and related executive orders, regulations, and actions which threaten fundamental rights and liberties guaranteed under the United States Constitution.

IT IS FURTHER RESOLVED that the City of Pasadena:

(A) Supports legislation to repeal provisions in the USA Patriot Act and related Executive Orders that violate the Constitution of the United States and the civil rights and civil liberties of individuals;

(B) Opposes any legislative or administrative action that would strengthen government's ability to violate individual privacy and civil rights;

(C) Specifically opposes Section 215 and Section 216 of the USA Patriot Act and any other legislation or administrative action which unduly requires libraries to violate the privacy rights of patrons by monitoring, reporting, and /or disclosing their borrowing practices or library use history beyond what is required by California Law.

(D) Opposes military detention, secret detention, secret immigration proceedings, or detention without access to counsel, of individuals within the City of Pasadena;

(E) Opposes the surveillance of individuals or groups of individuals based on their participation in activities protected by the First Amendment, such as political advocacy or the practice of a religion, without reasonable suspicion of potential criminal activity; and

IT IS FURTHER RESOLVED that the Pasadena City Council directs the Mayor to:

(A) Transmit a copy of this Resolution to Senators Diane Feinstein and Barbara Boxer and to Representative Adam Schiff accompanied by a letter urging them to:

(1) Monitor federal anti-terrorism tactics and work to repeal provisions of the USA Patriot Act and other laws, regulations, and executive actions that infringe on civil rights and liberties as described in this Resolution;
(2) Take all possible actions to lead Congressional action to prohibit passage of further laws abridging civil liberties;
(3) Ensure that the sunset date of Title III of the Act remains in force and is honored;
(4) Support the proposed Freedom to Read Protection Act, the Patriot Act Oversight Restoration Act, and other current and future legislation consistent with this Resolution; and

(B) Transmit a copy of this Resolution to Governor Arnold Schwarzenegger, and appropriate members of the State Legislature, accompanied by a letter urging them to ensure that state anti-terrorism laws and policies be implemented in a manner that does not infringe on civil liberties as described in this Resolution; and

(C) Transmit a copy of this Resolution to President George W. Bush and United States Attorney General John Ashcroft.