1 Ruby Topic Maps on Shoes Benjamin Bock Maps User Conference Oslo, Norway, 2008-04-02

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Repaso: Unidad 2 Lección 2
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Myra Shields Training Manager Introduction to OvidSP.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Objectives: Generate and describe sequences. Vocabulary:
RXQ Customer Enrollment Using a Registration Agent (RA) Process Flow Diagram (Move-In) Customer Supplier Customer authorizes Enrollment ( )
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination. Introduction to the Business.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Microsoft Access 2007 Advanced Level. © Cheltenham Courseware Pty. Ltd. Slide No 2 Forms Customisation.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Supported by 1 1 kids learn from people who care welcome! velkomin!
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Windows XP Project An Introduction to Microsoft Windows XP and Office 2003.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Break Time Remaining 10:00.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
ACT User Meeting June Your entitlements window Entitlements, roles and v1 security overview Problems with v1 security Tasks, jobs and v2 security.
ETS4 - What's new? - How to start? - Any questions?
PP Test Review Sections 6-1 to 6-6
1 The Blue Café by Chris Rea My world is miles of endless roads.
EU market situation for eggs and poultry Management Committee 20 October 2011.
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Physical Aspects [Reflection Modelling] Hauptseminar: Augmented Reality for Driving Assistance in Cars.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
XML and Databases Exercise Session 3 (courtesy of Ghislain Fourny/ETH)
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Sample Service Screenshots Enterprise Cloud Service 11.3.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
Page 1 of 43 To the ETS – Bidding Query by Map Online Training Course Welcome This training module provides the procedures for using Query by Map for a.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
: 3 00.
5 minutes.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
ANSC644 Bioinformatics-Database Mining 1 ANSC644 Bioinformatics §Carl J. Schmidt §051 Townsend Hall §
Clock will move after 1 minute
PSSA Preparation.
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
RefWorks: The Basics October 12, What is RefWorks? A personal bibliographic software manager –Manages citations –Creates bibliogaphies Accessible.
1.step PMIT start + initial project data input Concept Concept.
Profile. 1.Open an Internet web browser and type into the web browser address bar. 2.You will see a web page similar to the one on.
Introduction Peter Dolog dolog [at] cs [dot] aau [dot] dk Intelligent Web and Information Systems September 9, 2010.
South Dakota Library Network MetaLib User Interface South Dakota Library Network 1200 University, Unit 9672 Spearfish, SD © South Dakota.
Presentation transcript:

1 Ruby Topic Maps on Shoes Benjamin Bock Maps User Conference Oslo, Norway,

2 Whassup today? Ruby Topic MapsShoes, a Tiny Toolkit

3 Im your Edutainer Benjamin Bock Ruby Coder Topic Maps Researcher Author of Ruby Topic Maps

4 And you? Programming Ruby, Java, …? Topic Mapping Pro or N00b ? Working Front or Back Office?

5 Schedule Ruby Topic Maps Shoes, a Tiny Toolkit Your own application

6 Ruby Topic Maps (RTM) Topic Maps Engine Easy Programming Interface (TMAPI++) Database Backend

7 RTM is for you Optimized for programmer happiness ( like Rails and Shoes are ) Direct access to properties ( productivity++ )* Beautiful code: easy to read and understand ( Ruby has low line-noise ) * Btw, the ++ operator known from other languages is not available in Ruby, use += 1 instead.

8 RTM is opinionated Convention over Configuration just start using it Do what I want - functionality dont query objects, just use them Standards compliant and a little more predefined associations

9 RTM is structured Back-end based on ActiveRecord* Programming interface is a wrapper layer Integrated Ruby-style query language * Thats the model part (i.e. relational database mapper) from Ruby on Rails

10 RTM is written in Ruby Ruby is object-oriented but also procedural and functional everything is an object dynamic and (but) strong typed

11 begin puts "Do you need a Ruby Introduction?" x = gets end until x =~ /(yes|no)/i open("Ruby Intro") if x=~/yes/i

12 Loading # loading the Ruby Topic Maps library require 'rtm' # Connecting to a back-end RTM.connect # Memory RTM.connect_sqlite3("mydb.sqlite3") RTM.connect_mysql("database_name", "user_name", "password", "host")

13 Initialization # generate database schema RTM.generate_database # enable SQL statement logging RTM.log # create a TopicMap tm = RTM.create "

14 Getting Topics (overview) # get a topic using its identifiers: # item identifier: t1 = tm.get("item-identifier") # subject identifier: t2 = tm.get(" # subject locator: t3 = tm.get("=

15 Getting Topics I # get by item identifier t1 = tm.get("item-identifier") # * use relative IRIs # * returns nil if not found # for using absolute IRI: t1 = tm.by_item_identifier( "absolute:/item-identifier") # * the latter might be TopicMapsConstruct, too

16 Getting Topics II # get by subject identifier t1 = tm.get("absolute:/identifier") # * use absolute IRIs # * returns nil if not found # or use the direct method: t1 = tm.topic_by_subject_identifier( "absolute:/subject-identifier")

17 Getting Topics III # get by subject locator t1 = tm.get("= # * similar to subject identifier # * prefix with "=" # or use the direct method: t1 = tm.topic_by_subject_locator( " # * no prefix needed here

18 Creating Topics (overview) # similar to getting, add ! to method # item identifier: t1 = tm.get!("item-identifier") # subject identifier: t2 = tm.get!(" # subject locator: t3 = tm.get!("=

19 Creating Topics (continued) # similar to getting, add ! to method # item identifier: t1 = tm.topic_by_item_identifier!( "item_identifier") # => always returns a Topic # subject identifier: t2 = tm.topic_by_subject_identifier!( " # subject locator: t3 = tm.topic_subject_locator( " # no =

20 Setting and getting occurrences using ["occurrence-type-get-id"] t1["age"] = 25 # * creates a new occurrence # * sets type to topic_map.get!("age") # * sets value to 25 and datatype to int t1["age"] # * fetches all occurrences of t1 with given type

21... and (almost) the same for names Using [ "-name-type-get-id" ], like occurrence but prefixed with "-" # using [occurrence-type-get-id"] t1["-firstname"] = "Benjamin # no type -> default TMDM name type t1["-"] = "Benjamin Bock"

22 Creating TopicMapConstructs # create a new Topic t = tm.create_topic #see also: get!(ref) # create a new Association a = tm.create_association # create AssociationRoles r = a.cr "player", RTM ::PSI[:type]

23 Associations Role Player Role Role Type Association Type Association Topic Association Role

24 Associations perspective Role Player Role Role Type Association Type roles type Topic Map topic_map TMAPI

25 Associations perspective Role Player role_players Role Type Association Type roles role_types Topic Map parent TMAPI++ role_players role_types type

26 Roles perspective Role Player Role Type Association Type association type TMAPI type player

27 Roles perspective Role Player Role Type Association Type counterparts type TMAPI++ type player counterplayers

28 Topics perspective Role Player associations_played Role Type Association Type roles_typed TMAPI++ associations_played roles_typed associations_typed roles * * roles can also be called roles_played counterparts counterplayers

29 Navigation # getting a topic t = tm.get!("my-topic") # getting its default name defname = t[ "-" ].first # there might be many, so it is a set, # we take the first TopicName object we get # get a list of all its variants values defname.variants.map {|v| v.value} # there is a shortcut for simple mapping: defname.variants.value

30 Querying # Get all Topics without name m.t.select {|t| t.n.size == 0 } # Get all Association types ti = m.a.map {|a| a.type }.uniq

31 Import and Export # Import an XTM 2.0 file RTM.from_xtm2(io_stream, "base_locator") # Or use much faster libxml RTM.from_xtm2lx(file_name, "base_locator") # Export a complete topic map xml_string = m.to_xtm2

32 Questions?

33 Schedule Ruby Topic Maps Shoes, a Tiny Toolkit Your own application

34 Shoes, a Tiny Toolkit windowing toolkit cool graphic features informal style uses ruby cross platform documentation is art

35 Hello World Shoes.app { button("Press Me") { alert("You pressed me") }

36

37 Stacks and Flows Only vertical scrolling: width is fixed height goes on Like on the web: stack for block-style flow for inline-style

38 Nobody knows Shoes an experimental tech book slim and punchy cheap and cartoony available as paperback and free pdf online

39

40 Schedule Ruby Topic Maps Shoes, a Tiny Toolkit Your own application

41 Your own application I brought 2 topic maps for you Opera by Steve Pepper¹ Topic Maps by Robert Cerny² Youre invited use your own, if you like! ¹ The topic map is part of OKS, ² Created with Topincs, hosted at

42 Schedule Ruby Topic Maps Shoes, a Tiny Toolkit Your own application

43 Outlook Need to fix some bugs (even) Higher Level API in sight 1,2 Community wanted! ¹ Search the source code for index_property_set ² see Dmitry Bogachevs Blog,

44 Thank you! Questions?