Difference between revisions of "GenerateProperties"

From BITPlan royal-family Wiki
Jump to navigation Jump to search
(created by WikiTask 2017-10-07T05:08:53Z)
(created by WikiTask 2017-10-08T05:56:01Z)
Line 140: Line 140:
  
 
= result =
 
= result =
2017-10-07T05:08:44Z
+
2017-10-08T05:55:54Z
 
2 Topics need Properties to be generated
 
2 Topics need Properties to be generated
  
 
== Topic: Person ==
 
== Topic: Person ==
 
=== properties of Person ===
 
=== properties of Person ===
==== [[Property:Person id]] ====
+
==== [[Property:Person qid]] ====
  
 
<pre>
 
<pre>
  
 
{{Property
 
{{Property
|name=id
+
|name=qid
|label=id
+
|label=qid
|documentation=the id of a Person in the GEDCOM standard
+
|documentation=the id of a Person in WikiData
 
|type=Special:Types/Text
 
|type=Special:Types/Text
 
|index=1
 
|index=1
Line 158: Line 158:
 
|primaryKey=true
 
|primaryKey=true
 
|mandatory=true
 
|mandatory=true
 +
|namespace=
 +
|size=
 +
|uploadable=false
 +
|defaultValue=
 +
|inputType=
 +
|allowedValues=
 +
|values_from=
 +
|showInGrid=true
 +
|isLink=false
 +
|topic=Concept:Person
 +
|storemode=property
 +
}}
 +
[[Has type::Text]]
 +
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}
 +
</pre>
 +
==== [[Property:Person royal92id]] ====
 +
 +
<pre>
 +
 +
{{Property
 +
|name=royal92id
 +
|label=royal92id
 +
|documentation=the royal92id of a Person in the GEDCOM standard
 +
|type=Special:Types/Text
 +
|index=2
 +
|sortPos=
 +
|primaryKey=
 +
|mandatory=
 
|namespace=
 
|namespace=
 
|size=
 
|size=
Line 180: Line 208:
 
|name=name
 
|name=name
 
|label=name
 
|label=name
|documentation=
+
|documentation=The full name of the person
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=2
+
|index=3
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 208: Line 236:
 
|name=nobleTitle
 
|name=nobleTitle
 
|label=nobleTitle
 
|label=nobleTitle
|documentation=
+
|documentation=The noble title of the person
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=3
+
|index=4
 
|sortPos=
 
|sortPos=
 
|primaryKey=
 
|primaryKey=
Line 236: Line 264:
 
|name=picture
 
|name=picture
 
|label=picture
 
|label=picture
|documentation=The picture of a person
+
|documentation=The URL of a picture of the person
 
|type=Special:Types/URL
 
|type=Special:Types/URL
|index=4
+
|index=5
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 266: Line 294:
 
|documentation=the gender of a person - female or male
 
|documentation=the gender of a person - female or male
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=5
+
|index=6
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 275: Line 303:
 
|defaultValue=
 
|defaultValue=
 
|inputType=radiobutton
 
|inputType=radiobutton
|allowedValues=
+
|allowedValues=female,male
|values_from=female,male
+
|values_from=
 
|showInGrid=true
 
|showInGrid=true
 
|isLink=false
 
|isLink=false
Line 294: Line 322:
 
|documentation=The date the person was born
 
|documentation=The date the person was born
 
|type=Special:Types/Date
 
|type=Special:Types/Date
|index=6
+
|index=7
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 322: Line 350:
 
|documentation=The year the person was born
 
|documentation=The year the person was born
 
|type=Special:Types/Number
 
|type=Special:Types/Number
|index=7
+
|index=8
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 348: Line 376:
 
|name=monthBorn
 
|name=monthBorn
 
|label=monthBorn
 
|label=monthBorn
|documentation=
+
|documentation=The month the person was born
 
|type=Special:Types/Number
 
|type=Special:Types/Number
|index=8
+
|index=9
 
|sortPos=
 
|sortPos=
 
|primaryKey=
 
|primaryKey=
Line 376: Line 404:
 
|name=birthPlace
 
|name=birthPlace
 
|label=birthPlace
 
|label=birthPlace
|documentation=
+
|documentation=The location where the person was born
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=9
+
|index=10
 
|sortPos=
 
|sortPos=
 
|primaryKey=
 
|primaryKey=
Line 406: Line 434:
 
|documentation=the date the person died
 
|documentation=the date the person died
 
|type=Special:Types/Date
 
|type=Special:Types/Date
|index=10
+
|index=11
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 432: Line 460:
 
|name=diedAt
 
|name=diedAt
 
|label=diedAt
 
|label=diedAt
|documentation=
+
|documentation=The location where the person died
 
|type=Special:Types/Text
 
|type=Special:Types/Text
|index=11
+
|index=12
 
|sortPos=
 
|sortPos=
 
|primaryKey=
 
|primaryKey=
Line 460: Line 488:
 
|name=yearDied
 
|name=yearDied
 
|label=yearDied
 
|label=yearDied
|documentation=
+
|documentation=The year the person died
 
|type=Special:Types/Number
 
|type=Special:Types/Number
|index=12
+
|index=13
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 488: Line 516:
 
|name=monthDied
 
|name=monthDied
 
|label=monthDied
 
|label=monthDied
|documentation=
+
|documentation=The month the person died
 
|type=Special:Types/Number
 
|type=Special:Types/Number
|index=13
+
|index=14
 
|sortPos=
 
|sortPos=
 
|primaryKey=
 
|primaryKey=
Line 516: Line 544:
 
|name=noInLine
 
|name=noInLine
 
|label=noInLine
 
|label=noInLine
|documentation=the number in Line of this person
+
|documentation=the number in Line to the Throne of this person
 
|type=Special:Types/Number
 
|type=Special:Types/Number
|index=14
+
|index=15
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false
Line 546: Line 574:
 
|documentation=the wikiPedia link of the Person
 
|documentation=the wikiPedia link of the Person
 
|type=Special:Types/URL
 
|type=Special:Types/URL
|index=15
+
|index=16
 
|sortPos=
 
|sortPos=
 
|primaryKey=false
 
|primaryKey=false

Revision as of 06:56, 8 October 2017

Action
edit
name  GenerateProperties
servicetype  WikiTask
service  
inputtype  Page
input  GenerateProperties#sidif
actionpage  GenerateProperties#template
output  GenerateProperties#result
engine  rythm
author  Wf
since  2015/11/18
comment  This saves a lot of work!

login reset runtemplate -> GenerateProperties#result


[edit]

sidif

FamilyContext isA Context
"FamilyContext#sidif"is sidif of it
Person needs Properties
Family needs Properties

metamodel sidif

MetaModel isA Context
"MetaModel#sidif"is sidif of it
Topic needs Properties
Property needs Properties
SMW_Type needs Properties
Context needs Properties
TopicLink needs Properties
Action needs Properties

presentation sidif

Presentation isA Context
"Presentation#sidif"is sidif of it
Bigstock needs Properties

Training sidif

Training isA Context
"Training#sidif"is sidif of it
Quizkarte needs Properties

Syllabus sidif

Syllabus isA Context
"Syllabus#sidif"is sidif of it
LearningGoal needs Properties

CRM Sidif

CRM isA Context
"CRM#sidif"is sidif of it
Organization needs Properties
Person needs Properties
Contact needs Properties
SocialLink needs Properties
[edit]
@// This is a rythm template
@import org.sidif.triple.TripleQuery
@import org.sidif.triple.Triple
@import org.sidif.wiki.SSLWiki
@import com.bitplan.topic.ContextSetting.TripleStoreMode
@import com.alibaba.fastjson.JSON
@import com.bitplan.mediawiki.japi.MediawikiApi
@import com.bitplan.mediawiki.japi.Mediawiki
@import com.bitplan.mediawiki.japi.api.Api
@include(wiki.SiDIFTemplates.propertiesdefs)
@args() {
  String title 
  String logo
  org.sidif.wiki.WikiTask wikiTask
  org.sidif.triple.TripleStore tripleStore
}
@{
  TripleQuery query=tripleStore.query();
  TripleQuery needed=query.query(null,"needs","Properties");
  Triple contextTriple=query.selectSingle(null,"isA","Context");
  String contextName=contextTriple.getSubject().toString();
  Triple sidifTriple=query.selectSingle(contextName,"sidif", null);
  String contextSidif=sidifTriple.getObject().toString();
  // now get the context
  ContextSetting contextSetting=ContextSetting.fromWikiTask(wikiTask);
  contextSetting.setContextName(contextName);
  contextSetting.setSidifInput(contextSidif);
  contextSetting.setTripleStoreMode(TripleStoreMode.SiDIF);
  Context context = ContextFactory.getInstance().getContext(contextSetting);
}
@(wikiTask.getWiki().getIsoTimeStamp())
@(needed.size()) Topics need Properties to be generated
@for (Triple neededTriple:needed.getTriples()) {
@{
  String topicName=neededTriple.getSubject().toString();
  Topic topic=context.byName(topicName);
}
== Topic: @(topicName) ==
=== properties of @(topic.name) ===
@for (Property property:topic.getProperties()) {
==== [[Property:@(topic.name) @(property.name)]] ====
@{
  Throwable error=null;
  try {
    // get the Rythm template result
    org.rythmengine.utils.RawData pageContentRaw=property(topic,property);
    String pageContent=pageContentRaw.toString();
    String pageTitle="Property:"+topic.name+" "+property.name;
    SSLWiki wiki=(SSLWiki)wikiTask.getWiki();
    String currentContent=wiki.getPageContent(pageTitle);
    // if (currentContent==null || currentContent.length()==0) {
      String summary="generated by GenerateProperties at "+wiki.getIsoTimeStamp();
      wiki.edit(pageTitle,pageContent,summary);
    // }
  } catch (Throwable th) {
    error=th;
  }
}
@if (error) {
<span style='color:red'>Error: @(error.getMessage())</span>
}
<pre>
@property(topic,property)
</pre>
}
}


[edit]

2017-10-08T05:55:54Z 2 Topics need Properties to be generated

Topic: Person

properties of Person

Property:Person qid


{{Property
|name=qid
|label=qid
|documentation=the id of a Person in WikiData
|type=Special:Types/Text
|index=1
|sortPos=
|primaryKey=true
|mandatory=true
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person royal92id


{{Property
|name=royal92id
|label=royal92id
|documentation=the royal92id of a Person in the GEDCOM standard
|type=Special:Types/Text
|index=2
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person name


{{Property
|name=name
|label=name
|documentation=The full name of the person
|type=Special:Types/Text
|index=3
|sortPos=
|primaryKey=false
|mandatory=true
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person nobleTitle


{{Property
|name=nobleTitle
|label=nobleTitle
|documentation=The noble title of the person
|type=Special:Types/Text
|index=4
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person picture


{{Property
|name=picture
|label=picture
|documentation=The URL of a picture of the person
|type=Special:Types/URL
|index=5
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::URL]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person sex


{{Property
|name=sex
|label=sex
|documentation=the gender of a person - female or male
|type=Special:Types/Text
|index=6
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=radiobutton
|allowedValues=female,male
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person born


{{Property
|name=born
|label=born
|documentation=The date the person was born
|type=Special:Types/Date
|index=7
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=datetime
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person yearBorn


{{Property
|name=yearBorn
|label=yearBorn
|documentation=The year the person was born
|type=Special:Types/Number
|index=8
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person monthBorn


{{Property
|name=monthBorn
|label=monthBorn
|documentation=The month the person was born
|type=Special:Types/Number
|index=9
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person birthPlace


{{Property
|name=birthPlace
|label=birthPlace
|documentation=The location where the person was born
|type=Special:Types/Text
|index=10
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person died


{{Property
|name=died
|label=died
|documentation=the date the person died
|type=Special:Types/Date
|index=11
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person diedAt


{{Property
|name=diedAt
|label=diedAt
|documentation=The location where the person died
|type=Special:Types/Text
|index=12
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person yearDied


{{Property
|name=yearDied
|label=yearDied
|documentation=The year the person died
|type=Special:Types/Number
|index=13
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person monthDied


{{Property
|name=monthDied
|label=monthDied
|documentation=The month the person died
|type=Special:Types/Number
|index=14
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person noInLine


{{Property
|name=noInLine
|label=noInLine
|documentation=the number in Line to the Throne of this person
|type=Special:Types/Number
|index=15
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person wikiPedia


{{Property
|name=wikiPedia
|label=wikiPedia
|documentation=the wikiPedia link of the Person
|type=Special:Types/URL
|index=16
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=true
|isLink=false
|topic=Concept:Person
|storemode=property
}}
[[Has type::URL]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Person childOf


{{Property
|name=childOf
|label=childOf
|documentation=
|type=Special:Types/Page
|index=
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=dropdown
|allowedValues=
|values_from=concept=Family
|showInGrid=
|isLink=true
|topic=Concept:Person
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Topic: Family

properties of Family

Property:Family name


{{Property
|name=name
|label=name
|documentation=the name of the family
|type=Special:Types/Text
|index=1
|sortPos=
|primaryKey=false
|mandatory=true
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family weddingDate


{{Property
|name=weddingDate
|label=weddingDate
|documentation=The date of the wedding
|type=Special:Types/Date
|index=2
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=datepicker
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family weddingPlace


{{Property
|name=weddingPlace
|label=weddingPlace
|documentation=
|type=Special:Types/Text
|index=3
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Text]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family yearMarried


{{Property
|name=yearMarried
|label=yearMarried
|documentation=
|type=Special:Types/Number
|index=4
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family monthMarried


{{Property
|name=monthMarried
|label=monthMarried
|documentation=
|type=Special:Types/Number
|index=5
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Number]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family divorced


{{Property
|name=divorced
|label=divorced
|documentation=
|type=Special:Types/Date
|index=6
|sortPos=
|primaryKey=false
|mandatory=false
|namespace=
|size=
|uploadable=false
|defaultValue=
|inputType=
|allowedValues=
|values_from=
|showInGrid=false
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Date]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family parentOf


{{Property
|name=parentOf
|label=parentOf
|documentation=the person that the nobleTitle is inheritable from
|type=Special:Types/Page
|index=8
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=combobox
|allowedValues=
|values_from=concept=Person
|showInGrid=
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family husbandOf


{{Property
|name=husbandOf
|label=husbandOf
|documentation=the male head of family/ father
|type=Special:Types/Page
|index=9
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=combobox
|allowedValues=
|values_from=concept=Person
|showInGrid=
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}

Property:Family wifeOf


{{Property
|name=wifeOf
|label=wifeOf
|documentation=the female head of family / mother
|type=Special:Types/Page
|index=10
|sortPos=
|primaryKey=
|mandatory=
|namespace=
|size=
|uploadable=
|defaultValue=
|inputType=combobox
|allowedValues=
|values_from=concept=Person
|showInGrid=
|isLink=false
|topic=Concept:Family
|storemode=property
}}
[[Has type::Page]]
This is a Property with type {{#show: {{FULLPAGENAMEE}} | ?Property type#- }}