Difference between revisions of "DblpConf"

From OPENRESEARCH th copy Wiki
Jump to navigation Jump to search
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
 
==Task==
 
==Task==
Migrate [https://or.bitplan.com/index.php/SiDIFTemplates SiDIF] template generator from java to python  
+
Migrate [https://or.bitplan.com/index.php/SiDIFTemplates SiDIF] template generator from java to [https://github.com/WolfgangFahl/py-sidif python]
  
 
==Goal==
 
==Goal==
Start with simple things like [https://or.bitplan.com/index.php/SiDIFTemplates#help help] or [https://or.bitplan.com/index.php/SiDIFTemplates#listof listof]
+
==Procdure==
+
* Start with simple things like [https://or.bitplan.com/index.php/SiDIFTemplates#help help] or [https://or.bitplan.com/index.php/SiDIFTemplates#listof listof]
Checkout [https://confident.dbis.rwth-aachen.de/dblpconf/ dblp]
+
* Complete to all necessary including Forms and Template
 +
* use lamda actions
 +
* Given a topic and a selected template generate page e.g. topic=Sourcecode template=help
 +
* Refactor LambdaActions to py-3rdparty-media
  
 +
==Procedure==
 +
* Checkout [https://confident.dbis.rwth-aachen.de/dblpconf/ dblp]
 +
* Read https://www.semantic-mediawiki.org/wiki/Metadata_management von [http://www.cef-cfr.ca/uploads/Membres/PierreRacine-SMWCon2013-SMW_Metaproperties.pdf Pierre Racine]
  
 +
===[http://wiki.bitplan.com/index.php/Category:Wikitask_Tutorial wikitask background] ===
 +
# Input: Triples (in SIDIF notation)
 +
# Template: Rythm Template (with embedded Java Code and libraries
 +
# Output: a Wikipage (or section of a page)
 +
 +
=== Define Lambda Actions ===
 +
# Input: Query -> List of dicts (triples)
 +
# Lambda Function: python
 +
# Result: depending on function (side effect)
 +
 +
=== Potential Input ===
 
{{#ask: [[isA::Property]]
 
{{#ask: [[isA::Property]]
 
}}
 
}}
 +
 +
= Sourcecode concept =
 +
<source lang='bash'>
 +
pushconcept -s test -t wiki Sourcecode
 +
pushing concept Sourcecode from test to wiki
 +
copying 5 pages from test to wiki
 +
1/5 (  20%): copying Concept:Sourcecode ...✅
 +
copying image File:SourceCodeLogo-64px.png ...❌:'url'
 +
2/5 (  40%): copying Template:Sourcecode ...✅
 +
3/5 (  60%): copying Form:Sourcecode ...✅
 +
4/5 (  80%): copying Help:Sourcecode ...✅
 +
copying image File:SourceCodeLogo-64px.png ...❌:'url'
 +
copying image File:Help Icon.png ...False:exists
 +
nochange
 +
duplicateversions
 +
 +
5/5 ( 100%): copying Category:Sourcecode ...✅
 +
copying 6 pages from test to wiki
 +
1/6 (  17%): copying Property:Sourcecode author ...✅
 +
2/6 (  33%): copying Property:Sourcecode id ...✅
 +
3/6 (  50%): copying Property:Sourcecode lang ...✅
 +
4/6 (  67%): copying Property:Sourcecode since ...✅
 +
5/6 (  83%): copying Property:Sourcecode text ...✅
 +
6/6 ( 100%): copying Property:Sourcecode url ...✅
 +
copying 1 pages from test to wiki
 +
1/1 ( 100%): copying CodeSchema ...
 +
</source>
 +
 +
 +
== Template Example ==
 +
 +
<pre>
 +
@include(wiki.SiDIFTemplates.defs)
 +
@def help(Topic topic) {
 +
[[File:Help_Icon.png|right]]
 +
== Help for @(topic.name) ==
 +
@topicheader(topic)
 +
=== Documentation ===
 +
@topic.wikiDocumentation
 +
=== Example @(topic.pluralName) ===
 +
{{#ask: [[Concept:@(topic.name)]]
 +
}}
 +
=== Properties ===
 +
{{#ask: [[Concept:Property]][[Property topic::Concept:@(topic.name)]]
 +
| ?Property documentation = documentation
 +
| ?Property type = type
 +
| ?Property name = name
 +
| ?Property label = label
 +
| ?Property allowedValues = allowedValues
 +
| ?Property mandatory = mandatory
 +
| ?Property uploadable = uploadable
 +
|format=table
 +
}}
 +
 +
@uml("uml",topic)
 +
@seealso(topic)
 +
[[Category:@topic.name]]
 +
}
 +
@{
 +
  ContextSetting contextSetting=ContextSetting.fromWikiTask(wikiTask);
 +
}
 +
@help(contextSetting.getMaintopic())
 +
 +
</pre>
 +
 +
= Questions =
 +
* What is the desired behavior during page generation if page already exists? Update, overwrite or append
 +
    Overwrite
 +
 +
* What is the expected input/putput of seealso and uml in case of help? In topic [http://wiki.bitplan.com/index.php/Concept:PID Concept:PID] uml is a section with text and seealso is embedded  into {{#concept: ...}
 +
<source>
 +
@def seealso(Topic topic) {
 +
see also
 +
* [[List of @(topic.pluralName)]]
 +
* [[Help:@topic.name]]
 +
* [[Concept:@topic.name]]
 +
* [[:Category:@topic.name]]
 +
* [[:Template:@topic.name]]
 +
* [[:Form:@topic.name]]
 +
topic links:
 +
@for (TopicLink topicLink:topic.sourceTopicLinks.mTopicLinks) {
 +
@if (topicLink.targetTopic) {
 +
* [[:Category:@(topicLink.targetTopic.name)]]
 +
}
 +
}
 +
}
 +
</source>
 +
= Implementation =
 +
Documentation of the [[LambdaActions]] implementation.
 +
Current state:
 +
* Added smw as query language
 +
* Added jinja Template as action -> Generates wiki pages based on the query input and defined template
 +
 +
== Example Page Generations ==
 +
* [[Help:Sourcecode]]
 +
* [[ListOf:Sourcecode]]
 +
[[Category:Task]]

Latest revision as of 15:42, 12 February 2021

Task

Migrate SiDIF template generator from java to python

Goal

  • Start with simple things like help or listof
  • Complete to all necessary including Forms and Template
  • use lamda actions
  • Given a topic and a selected template generate page e.g. topic=Sourcecode template=help
  • Refactor LambdaActions to py-3rdparty-media

Procedure

wikitask background

  1. Input: Triples (in SIDIF notation)
  2. Template: Rythm Template (with embedded Java Code and libraries
  3. Output: a Wikipage (or section of a page)

Define Lambda Actions

  1. Input: Query -> List of dicts (triples)
  2. Lambda Function: python
  3. Result: depending on function (side effect)

Potential Input

Abstract deadline, Acceptance rate, Accepted papers, Accepted short papers, Acronym, Action actionpage, Action author, Action comment, Action engine, Action input, Action inputtype, Action name, Action output, Action service, Action servicetype, Action since, Attendance fee, Attendance fee currency, Attendance fee reduced, Bigstock file, Bigstock id, BlogEntry author, BlogEntry date, BlogEntry pdf, BlogEntry title, Bogensportverein lat, Bogensportverein lon, Bogensportverein name, Bogensportverein url, Bogenturnier date, Bogenturnier name, Bogenturnier url, Bogenturnier veranstalter, Brainteaser date, Brainteaser finishDate, Brainteaser issue, Brainteaser page, Brainteaser pdf, Brainteaser problem, Brainteaser solution, CANInfo description, CANInfo name, CANInfo pid, CANInfo unit, Camera ready due, City name, City wikidataid, Commit date, Commit hash, Commit host... further results

Sourcecode concept

pushconcept -s test -t wiki Sourcecode
pushing concept Sourcecode from test to wiki
copying 5 pages from test to wiki
1/5 (  20%): copying Concept:Sourcecode ...✅
copying image File:SourceCodeLogo-64px.png ...❌:'url'
2/5 (  40%): copying Template:Sourcecode ...✅
3/5 (  60%): copying Form:Sourcecode ...✅
4/5 (  80%): copying Help:Sourcecode ...✅
copying image File:SourceCodeLogo-64px.png ...❌:'url'
copying image File:Help Icon.png ...False:exists
nochange
duplicateversions

5/5 ( 100%): copying Category:Sourcecode ...✅
copying 6 pages from test to wiki
1/6 (  17%): copying Property:Sourcecode author ...✅
2/6 (  33%): copying Property:Sourcecode id ...✅
3/6 (  50%): copying Property:Sourcecode lang ...✅
4/6 (  67%): copying Property:Sourcecode since ...✅
5/6 (  83%): copying Property:Sourcecode text ...✅
6/6 ( 100%): copying Property:Sourcecode url ...✅
copying 1 pages from test to wiki
1/1 ( 100%): copying CodeSchema ...


Template Example

@include(wiki.SiDIFTemplates.defs)
@def help(Topic topic) {
[[File:Help_Icon.png|right]]
== Help for @(topic.name) ==
@topicheader(topic)
=== Documentation ===
@topic.wikiDocumentation
=== Example @(topic.pluralName) ===
{{#ask: [[Concept:@(topic.name)]]
}}
=== Properties ===
{{#ask: [[Concept:Property]][[Property topic::Concept:@(topic.name)]]
| ?Property documentation = documentation
| ?Property type = type
| ?Property name = name
| ?Property label = label
| ?Property allowedValues = allowedValues
| ?Property mandatory = mandatory
| ?Property uploadable = uploadable
|format=table
}}

@uml("uml",topic)
@seealso(topic)
[[Category:@topic.name]]
}
@{
  ContextSetting contextSetting=ContextSetting.fromWikiTask(wikiTask);
}
@help(contextSetting.getMaintopic())

Questions

  • What is the desired behavior during page generation if page already exists? Update, overwrite or append
   Overwrite
  • What is the expected input/putput of seealso and uml in case of help? In topic Concept:PID uml is a section with text and seealso is embedded into {{#concept: ...}
 @def seealso(Topic topic) {
see also
* [[List of @(topic.pluralName)]]
* [[Help:@topic.name]]
* [[Concept:@topic.name]]
* [[:Category:@topic.name]]
* [[:Template:@topic.name]]
* [[:Form:@topic.name]]
topic links:
@for (TopicLink topicLink:topic.sourceTopicLinks.mTopicLinks) {
@if (topicLink.targetTopic) {
* [[:Category:@(topicLink.targetTopic.name)]]
}
}
}

Implementation

Documentation of the LambdaActions implementation. Current state:

  • Added smw as query language
  • Added jinja Template as action -> Generates wiki pages based on the query input and defined template

Example Page Generations