2. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 2
Agenda
1. Organisational Issues
2. Linked Data
3. Continuous Delivery
4. Build Automation
5. Distributed Version Control
6. Task 1
3. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 3
Bachelor Practical Course - Module Description
• Intended Learning Outcomes: “Participants are able to design and
implement small software systems in a team. They know how to
apply engineering methods and models and can judge the risks and
typical problems encountered in software projects.”
• Content: “Participants exercise systematic software engineering for a
small system in small teams with a precise task description with tight
time constraints (design, implementation, test). Intermediate results
of the team work have to be presented. Design, project plans and
implementation have to be documented.”
• Work load: 300 total hours (90 contact hours, 21o self-study hours)
4. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 4
Organisational Issues
• 10 tasks (and 11 appointments)
• The tasks have to be solved in small teams
• Deadlines for the tasks are on the next tuesday evening
• Every solution counts 10% of the practical course
• The teams will present their solutions at the next appointment
• Every team member has to contribute to the solution
• Each task contains optional parts
6. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 6
Motivation
• Publish datasets over the web
• Query datasets effectively by applications
• Graph-based data model
• Extension, integration, inference and uniform querying
7. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 7
Queries
• “Retrieve a performance of the Beethoven violin concerto by a
Chinese orchestra”
• “Retrieve a photo of the conductor of this performance”
• “List male British rock musicians married to Scandinavians”
8. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 8
Background standards
• HyperText Transfer Protocol (HTTP)
• Uniform Resource Identifier (URI)
• eXtensible Markup Language (XML)
• Resource Description Framework (RDF)
• RDF Schema (RDFS)
• Web Ontology Language (OWL)
• SPARQL Protocol and RDF Query Language (SPARQL)
9. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 9
Uniform Resource Identifier (URI)
• A compact sequence of characters that identifies an abstract or
physical resource
• Data from different data sources has to be linked to indicate
synonyms
http://rdf.freebase.com/ns/en.ludwig_van_beethoven!
http://dbpedia.org/resource/Ludwig_van_Beethoven!
http://musicbrainz.org/artist/1f9df192-
a621-4f54-8850-2c5373b7eac9#_!
http://data.nytimes.com/N30866506154608358173
10. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 10
Resource Description Framework (RDF)
• Statements are represented as triples of the form subject-predicate-
object
<http://musicbrainz.org/artist/b10bbbfc-cf9e-42e0-be17-
e2c3e1d2600d>!
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>!
<http://musicontology.com/specification/#term-MusicGroup>.
11. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 11
RDF Schema (RDFS)
• Extension of RDF
• Allows resources to be classified explicitly as classes or properties
• Further statements like class-subclass or property-subproperty
relationships, and domain and range of a property
<mo:member> <rdf:type> <rdfs:Property>.
<mo:member> <rdfs:domain> <mo:MusicGroup>.
12. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 12
SPARQL Protocol and RDF Query Language
• Language for formulating queries over RDF data
• It is the Semantic Web's counterpart to SQL
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX music-ont: <http://purl.org/ontology/mo/>
SELECT ?album_name ?track_title WHERE {
dbpedia:The_Beatles foaf:made ?album .
?album dc:title ?album_name .
?album music-ont:track ?track .
?track dc:title ?track_title
}
13. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 13
Principles of Linked Data
• Use URIs to identify things.
• Use HTTP URIs so that people can look up those names.
• When someone looks up a URI, provide useful information, using
the standards (RDF, RDFS, SPARQL).
• Include links to other URIs, so that they can discover more things.
14. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 14
Rating published datasets
1-star: The data is available on the web with an open license.
2-star: The data is structured and machine-readable.
3-star: The data does not use a proprietary format.
4-star: The data uses only open standards from W3C (RDF, SPARQL).
5-star: The data is linked to that of other data providers.
15. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 15
Sites using Linked Data
• http://data.nytimes.com/schools/schools.html
• http://www.bbc.co.uk/music
• http://linkedgeodata.org/
• http://www.data.gov/
• http://data.gov.uk/
16. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 16
References
• EUCLID Project:
http://www.euclid-project.eu/modules/chapter1
18. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 18
Continuous Delivery - Motivation
• Goal: Deliver software as quickly as possible
• A lot of software development methodologies focus on requirement
engineering and impact on development effort
• Bottleneck: build, deploy, test and release process
19. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 19
Continuous Delivery - Release Antipatterns
• Deploying Software Manually
• Deploying to a Production-like only after Development is Complete
• Manual Configuration Management of Production Environments
20. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 20
Continuous Delivery - How to Achieve?
• Automated build, test, deploy and release process (repeatability)
• Frequent releases
• Every change should trigger the feedback process
• The feedback must be received as soon as possible
21. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 21
Continuous Delivery - Benefits
• Empowering Teams
• Reducing Errors
• Lowering Stress
• Deployment Flexibility
• Practice Makes Perfect
22. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 22
Continuous Delivery - Principles
• Create a Repeatable, Reliable Process for Releasing Software
• Automate Almost Everything
• Keep Everything in Version Control
• If It Hurts, Do It More Frequently, and Bring the Pain Forward
• Build Quality In
• Done Means Released
• Everybody is Responsible for the Delivery Process
• Continuous Improvement
23. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 23
Configuration Management - Definition
Configuration Management refers to the process by which all artefacts
relevant to your project, and the relationships between them, are stored,
retrieved and uniquely identified, and modified.
24. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 24
Configuration Management - Key Questions
• Can I exactly reproduce any of my environments and their
configuration?
• Can I easily make an incremental change and deploy to any, and all,
of my environments?
• Can I easily see each change that occurred to an environment and
trace it back to see exactly what the change was and who made it?
• Can I satisfy all of the compliance regulations that I am subject to?
• Does every member of the team easily get the information needed?
25. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 25
Configuration Management - Principles
• Use Version Control
• Manage Dependencies
• Manage Components
• Manage Software Configuration
• Manage Environments
26. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 26
Continuous Integration - Motivation
• The application should always be in a working state
• Not: “Yes, the application is finished, we only have to build it and run
some tests…”
27. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 27
Continuous Integration - Prerequisites
• A Version Control System
• An Automated Build
• Agreement of the Team
• Check in Regularly (to Trunk/Master)
• Create a Comprehensive Automated Test Suite
• Keep the Build and Test Process Short
• Manage Your Development Workspace
• A Continuous Integration Software (“Build Server”)
28. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 28
Continuous Integration - Essential Practices
• Don’t Check in on a Broken Build
• Always Run all Commit Tests locally before Checking Committing
• Wait for Commit Tests to Pass before Moving On
• Never Go Home on a Broken Build
• Always be Prepared to Revert to a Previous Revision
• Time-Box Fixing before Reverting
• Don’t Comment Out Failing Tests
• Take Responsibility for all Breakages That Result from Your Changes
• Test-Driven Development
31. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 31
Build Lifecycle - Phases
• validate
• compile
• test
• package
• integration-test
• verify
• install
• deploy
32. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 32
Plugins
• Plugins / Plugin Goals represent specific tasks
• Plugin Goals are bound to build phases
• Examples:
• compiler plugin
• jar plugin
• surefire plugin
• deploy plugin
33. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 33
Default Bindings - Packaging (jar)
• process-resources resources:resources
• compile compiler:compile
• process-test-resources resources:testResources
• test-compile compiler:testCompile
• test surefire:test
• package jar:jar
• install install:install
• deploy deploy:deploy
34. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 34
Project Object Model (POM / pom.xml)
• dependencies
• plugins / goals
• build profiles
• project version
• description
• developers
• …
35. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 35
Build Profiles
• Multiple Configurations / Environments
• Developer
• Team Build
• Production
• Build Profile Types
• Per Project
• Per User
• Global (per Maven Installation)
37. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 37
Dependency Mechanism
• Dependencies defined in POM are included automatically
• Transitive dependencies are included automatically
• Dependency Scopes
• compile
• provided
• runtime
• test
• system
• import
40. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 40
Git - Design Issues
• Speed
• Simple design
• Strong support for non-linear development
• Fully distributed
• Able to handle large projects like the Linux kernel efficiently
53. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 53
Software Development Environment
• Git Source Code Repositories (Atlassian Stash):
https://devschlichter.cs.tum.edu/source/
• Build Server (Atlassian Bamboo):
https://devschlichter.cs.tum.edu/ci/
• Maven Repository Manager (Sonatype Nexus):
https://devschlichter.cs.tum.edu/repo/
54. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 54
Technical Documentation
• Build Automation / Maven
• http://maven.apache.org/guides/
• Distributed Version Control / Git
• http://git-scm.com/book/
• http://help.eclipse.org/kepler/ (EGit Documentation)
• http://confluence.atlassian.com/display/STASH/
• Continuous Delivery / Bamboo
• http://confluence.atlassian.com/display/BAMBOO/
55. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 55
Important
• Build + test your project before creating commits!
• Create useful commit messages for each commit!
• Create a commit for each useful step!
• Push your commits to the server!
• Pull other’s commits from server!
• Create comments for your code and your tests!
• Format your code (the lines you changed)!
• Do not commit Eclipse configuration files or generated files!
• No Warnings / Errors / Code in Comments / …
56. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 56
Tasks
• Create a Maven 3 project
• Create a Git repository und push it to the server
• Configure your maven deployment settings + maven repository
• Enable your build plan
• Add jena and junit as maven dependencies
• http://jena.apache.org
• https://github.com/junit-team/junit/wiki/Download-and-Install
• Add unit test class[es] with test methods for the examples in
http://www.euclid-project.eu/modules/chapter2
57. Technische Universität München
Bachelor Practical Course Semantic Web - Part 1 57
Test Data
• The Beatles made the album “Help".
• The Beatles made the album "Abbey Road”.
• The Beatles made the album "Let it be”.
• The Beatles includes band-member Paul McCartney.
• Wings made the album "Band on the run”.
• Wings made the album "London Town”.
• Wings includes band-member Paul McCartney.
• The Rolling Stones made the album "Hot Rocks"