DBI 2007

advertisement
Applications of XML
Web Services • RSS • RDF
Web Services
"Web services are
loosely coupled software components
delivered over
standard Internet technologies."
DBI 2007
HUJI-CS
3
Example Scenario: Get Online Information
Get Stock Price
Get Stock Price
Stock Exchange
DBI 2007
Return Stock
Price
HUJI-CS
Return Stock
Price
Stock
Broker
Application
4
Example Scenario – Online Trade
Buy The Hobbit (5)
The Hobbit (5)
Price: 20.95
Copies in Stock: 4
5
How
Buy
Much?
it
Book Store
Buy The Hobbit (5)
Book Store
20.95
The Hobbit (5)
Price: 25.95
1
Copies in Stock: 0
DBI 2007
HUJI-CS
5
Example Scenario: Grid Computation
Grid Computation
Using seamlessly
the combined
resources of
many computers
that are connected
to the Internet
DBI 2007
HUJI-CS
6
What is a Web Service?
• Self-contained, modular Web application that
can be published, located and invoked across
the Web
• A Web service can perform functions of
varying complexities
• Once deployed, other applications (and other
Web services) can discover and invoke the
deployed service
DBI 2007
HUJI-CS
7
Calling Remote Functions Could Help
• It would help if we could call functions, such as:
– Amazon.getPrice(“The Hobbit")
– Amazon.buyBook(“The Hobbit", myId)
getPrice(…)
The
Internet
DBI 2007
HUJI-CS
8
Difficulties in Using Remote Functions
• For each remote function, we need to phrase a
call in the specific language that is used for its
implementation
• For each remote function, we need to contact the
provider in order to find out what exactly the
signature (i.e., parameters, return value, inc. the
type) is
• On the server side, each remote function needs
to listen to a server socket bound to a specific
port
– Not in line with protection by firewalls
DBI 2007
HUJI-CS
9
The Solution
• Use an agreed interface and a syntax that all
applications are familiar with (e.g., XML)
– For example, SOAP
• Use HTTP to transfer data through port 80
• Use a standard for publishing methods, their
signatures and their usage
– For example, WSDL
• Use standard directory structures for publishing
available services
– For example, UDDI
DBI 2007
HUJI-CS
10
DBI 2007
HUJI-CS
11
Web Services that are Already Available
• Google search (http://www.google.com/apis)
• Weather reports
• Stock prices
• Currency exchanges
• Sending SMS messages, faxes
• Prices of books in Barnes and Nobles
• Dictionaries
• etc.
DBI 2007
HUJI-CS
12
Implementing Web Services
• Programmers are given tools that spare the need
to directly write SOAP or WSDL documents
• In Java:
– JAX-RPC: part of SUN tools for publishing and
deploying Web Services
– AXIS: Apache’s tool for handling Web services in Java
• The combination of standards and management
tools (like Axis – next week) makes the invocation
of remote methods a very easy operation
DBI 2007
HUJI-CS
13
Programming the Services
• What programming language is used for Web
Services?
– They are independent from programming language
– HTTP can be implemented in any language
– XML contains data but not object (no methods, etc.)
• objects can be represented in XML and vice versa
– SOAP builds on top of XML (Infoset)
• Typical languages:
– Java, C#, Perl, PHP, Python, Ruby, …
DBI 2007
HUJI-CS
14
SOAP
Simple Object-Access Protocol
What is SOAP?
• SOAP is a protocol for accessing Web Services
• SOAP is XML based
– Thus, SOAP provides interoperability
• In SOAP, applications exchange information over
HTTP
– Thus, SOAP is not restricted by firewalls
• SOAP allows to exchange structured and typed
information on the Web
– XSchema types are used to add types to XML
• SOAP specification: http://www.w3.org/2000/xp/Group/
DBI 2007
HUJI-CS
16
SOAP Communication
DBI 2007
HUJI-CS
17
Soap Structure
Put a message into an envelope and describe
additional features in the header (payment, etc.)
SOAP Envelope
SOAP Header
- optional
SOAP Body
- required
DBI 2007
HUJI-CS
Fault
- optional
18
POST /soap HTTP/1.0
SOAPAction: ""
Content-Length: 520
A request to
services.xmethods.net:80
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getRate
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:xmethods-CurrencyExchange">
<country1 xsi:type="xsd:string">Euro</country1>
<country2 xsi:type="xsd:string">Israel</country2>
</ns1:getRate>
</soapenv:Body>
</soapenv:Envelope>
DBI 2007
HUJI-CS
19
HTTP/1.0 200 OK
Date: Sat, 07 May 2005 23:26:21 GMT
Content-Length: 492
The Response
Content-Type: text/xml
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<soap:Body>
<n:getRateResponse
xmlns:n='urn:xmethods-CurrencyExchange'>
<Result xsi:type='xsd:float'>5.5825</Result>
</n:getRateResponse>
</soap:Body>
</soap:Envelope>
DBI 2007
HUJI-CS
20
Example - Calling Google Spelling
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP
ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsi=“http://www.w3.org/1999/XMLSchema-instance”
xmlns:xsd=“http://www.w3.org/1999/XMLSchema”>
<SOAP-ENV:Body>
<ns1:doSpellingSuggestion xmlns:ns1=“urn:GoogleSearch” SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<key xsi:type="xsd:string">00000000000000000000000000</key>
<phrase xsi:type="xsd:string">britney speers</phrase>
</ns1:doSpellingSuggestion>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DBI 2007
HUJI-CS
21
Example - Google Spelling Response
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:doSpellingSuggestionResponse xmlns:ns1="urn:GoogleSearch“
SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">britney spears</return>
</ns1:doSpellingSuggestionResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DBI 2007
HUJI-CS
22
MD5 Transform
DBI 2007
HUJI-CS
23
Baghdad Weather
DBI 2007
HUJI-CS
24
Baghdad Weather
DBI 2007
HUJI-CS
25
World Cities
DBI 2007
HUJI-CS
26
World Cities
DBI 2007
HUJI-CS
27
Messaging Patterns
• Synchronous
– Remote procedure call
– Standard HTTP request
response
• What are the limitations
here?
message
Client
Service
A
reply
DBI 2007
HUJI-CS
28
Asynchronous Messaging
• Asynchronous
– A message is sent with directions
on where to send the reply when
it is ready.
• Generalize the callback model
Service
A
– Document oriented
– Tolerates long latencies
• Destination of reply may be
different from origin
message
Client
• Message may transit several
other services
• Analogy: Mail, Email, … To:
From:
DBI 2007
HUJI-CS
Reply
Dest.
Service
B
Service
c
reply
29
The SOAP Header
• A generic mechanism for adding features to a SOAP message
• Contained in the header are header blocks
– Some header blocks are marked as mandatory (mustUnderstand=“true”)
the rest can be ignored.
• The header blocks contain answers to questions like
– Where to send a reply or fault message
• i.e. how to handle asynchronous messaging
– What are the security requirements of this message
– Other “policy” issues that are involved
– Used by the reliable message protocol
• The header is the place where protocol composability takes place
DBI 2007
HUJI-CS
30
WS-Addressing
• A soap header used to
– Specify the final
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
destination and action
xmlns:wsa="http://www.w3.org/2004/12/addressing">
of a message
<S:Header>
– A unique identifier for <wsa:To>http://Z.com/ServiceURI</wsa:To>
<wsa:Action>http://Z.com/DoSomething</wsa:Action>
the message
<wsa:MessageID>
– The endpoint of a reply
http://example.com/SomeUniqueMessageIdString
– The endpoint of a fault </wsa:MessageID>
message
<wsa:ReplyTo>
<wsa:Address>http://X.com/someClient</wsa:Address>
– The details of an
</wsa:ReplyTo>
endpoint
<wsa:FaultTo>
reference
<wsa:Address>http://Y.com//ErrorHandler</wsa:Address>
</wsa:FaultTo>
</S:Header>
<S:Body>
<!-- The message body of the SOAP request appears here -->
</S:Body>
</S:Envelope>
DBI 2007
HUJI-CS
31
What is an endpoint reference?
• Specifies the complete details about how to get to
and identify a service
– My address …
• The simplest form
– <wsa:Address>http://X.com/myservice</wsa:Address>
• But more complex forms are possible
– For example qualifying a level of service
<wsa:EndpointReference xmlns:wsa="..." xmlns:painter="...">
<wsa:Address>http://housepainting.com</wsa:Address>
<wsa:ReferenceProperties>
<painter:ServiceLevel>Basic Paint Job</painter:ServiceLevel>
</wsa:ReferenceProperties>
</wsa:EndpointReference>
DBI 2007
HUJI-CS
32
Some More Details on SOAP
encodingStyle Attribute
• “The SOAP encodingStyle attribute indicates the encoding rules
used to serialize parts of a SOAP message”
– Needed when sending data structures
• This attribute may appear on any SOAP element, and it will apply to
that element's content and all child elements
• A SOAP message has no default encoding
– Unencoded data may be used in SOAP messages
• The SOAP default XMLSchema for SOAP encoding and data
types is:
http://www.w3.org/2002/12/soap-encoding
– Other encoding rules may be used
DBI 2007
HUJI-CS
34
SOAP Header Element
• The SOAP Header element is optional
• It contains application-specific information (like
authentication, payment, etc.) about the SOAP message
• If the Header element is present, it must be the first child
element of the Envelope element
• Attributes that the namespace defines:
– Role – used to address the Header element to particular
servers (relevant to p2p scenarios where a message can
reach several servers)
– mustUnderstand – used to indicate whether a header entry
is mandatory or optional for the recipient to process
– encodingStyle – as explained before
DBI 2007
HUJI-CS
35
SOAP Header Element
• Example:
<SOAP-ENV:Header>
<t:Transaction xmlns:t="some-URI"
SOAP-ENV:mustUnderstand="1">5
</t:Transaction>
</SOAP-ENV:Header>
• 5 is the transaction ID of which this method is a part
• In the above example, the SOAP-envelope attribute mustUnderstand is
set to 1, which means that the server must either understand and honor
the transaction request or must fail to process the message
DBI 2007
HUJI-CS
36
SOAP Response on Error
• There can be many errors in processing a SOAP request
• Error in Running Methods: For example, suppose that the
"Hello Server" does not allow anyone to say hello on
Tuesday
• Error in Processing SOAP Headers: For example, a
problem running the method as a part of a transaction
DBI 2007
HUJI-CS
37
The Fault Element May Include the
Following Sub-Elements
• <faultcode> : A code for identifying the fault
• <faultstring> : A human readable explanation of
the fault
• <faultactor> : Information about who caused the
fault
• <detail> : Holds application-specific error
information related to the Body element of the
SOAP request
DBI 2007
HUJI-CS
38
SOAP Fault Codes
• VersionMismatch: Found an invalid namespace for
the SOAP Envelope element
• MustUnderstand: An immediate child element of the
Header element, with the mustUnderstand attribute
set to 1, was not understood
• Client: The message was incorrectly formed or
contained incorrect information
• Server: There was a problem with the server so the
message could not proceed
DBI 2007
HUJI-CS
39
SOAP Error Response for Method Error
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<e:myfaultdetails xmlns:e="Hello">
<message>
Sorry, I cannot say hello on Tuesday.
</message>
<errorcode>1001</errorcode>
</e:myfaultdetails>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DBI 2007
HUJI-CS
40
SOAP Error Response for Header Error
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:MustUnderstand</faultcode>
<faultstring>SOAP Must Understand
Error</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
No detail element may appear when there is an error
in processing the Headers of a SOAP request
DBI 2007
HUJI-CS
41
Sending a Request
• The SOAP request does not contain the address
to which it should be sent
• Q: Where do we put the URL of the Web Service?
• A: It depends on the protocol used to send the
request (usually HTTP, but could also be another
protocol, e.g., SMTP)
DBI 2007
HUJI-CS
42
SOAP Request via HTTP
POST http://www.Hello.com/HelloApplication HTTP/1.0
Content-Type: text/xml; charset=UTF-8
Content-Length: 587
SOAPAction: urn:helloApp
<SOAP-ENV:Envelope …
Note: There are 2 addresses
(1) URL of a SOAP Server
(2) URI of an application to run (this needn't
correspond to an actual Internet address)
DBI 2007
HUJI-CS
43
SOAPAction Header
• Used to indicate the intent of the SOAP HTTP request
• The presence and content of the SOAPAction header field
can be used by servers, such as firewalls, to appropriately
filter SOAP request messages in HTTP
• The header-field value of an empty string ("") means that
the intent of the SOAP message is provided by the URL of
the HTTP Request
DBI 2007
HUJI-CS
44
WSDL
Web Services Definition Language
Describing a Web Service
• Need a standard way to describe a Web Service:
– the methods available
– their parameters
– etc.
• WSDL is a standard for describing Web services
using XML, i.e., it is a language for the green
pages of UDDI
• WSDL specification can be found at
http://www.w3.org/TR/wsdl
DBI 2007
HUJI-CS
46
The Web Service Definition Language
• A document used by a
client so that it has a
formal description of a
service
Service Registry
• Client fetches the WSDL
for a service from some
location
WSDL for
Service X
1
• Client uses the WSDL to
properly format the
SOAP request and to
understand the reply
2
3
Service
X
message
Client
4
reply
DBI 2007
HUJI-CS
47
WSDL Can Describe
• What a Web service can do
• Where it resides
• How to invoke it
DBI 2007
HUJI-CS
48
The Structure of a WSDL Document
<definition>
<type>
definition of a type
</type>
<definition>
<message>
definition of a message
<types>
</message>
<portType>
def. of operations (composed of messages)
<messages>
</portType>
<binding>
how to translate operations into SOAP
</binding>
<portTypes>
<bindings>
<service>
the location of the service
<service>
</service>
</definition>
DBI 2007
HUJI-CS
49
<?xml version="1.0"?>
<definitions name="CurrencyExchangeService"
targetNamespace="http://www.xmethods.net/sd/CurrencyExchangeService.wsdl"
xmlns:tns="http://www.xmethods.net/sd/CurrencyExchangeService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="getRateRequest">
<part name="country1" type="xsd:string"/>
<part name="country2" type="xsd:string"/>
</message>
<message name="getRateResponse">
<part name="Result" type="xsd:float"/>
</message>
<portType name="CurrencyExchangePortType">
<operation name="getRate">
<input message="tns:getRateRequest" name="getRate"/>
<output message="tns:getRateResponse"
name="getRateResponse"/>
</operation></portType>
DBI 2007
HUJI-CS
50
<binding name="CurrencyExchangeBinding" type="tns:CurrencyExchangePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getRate">
<soap:operation soapAction=""/>
<input name="getRate">
<soap:body use="encoded" namespace="urn:xmethods-CurrencyExchange"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="getRateResponse">
<soap:body use="encoded" namespace="urn:xmethods-CurrencyExchange"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="CurrencyExchangeService">
<documentation>Returns the exchange rate between the two currencies</documentation>
<port name="CurrencyExchangePort" binding="tns:CurrencyExchangeBinding">
<soap:address location="http://services.xmethods.net:80/soap"/>
</port>
</service>
</definitions>
DBI 2007
HUJI-CS
51
The Elements of WSDL Documents
• Types – containing XML Schema element and type
definitions
• Message – an abstract typed definition of the data
being communicated
• Operation – an abstract description of an action
supported by the service
• Port Type – an abstract set of operations supported
by one or more endpoints
• Binding – a concrete communication protocol and
data format specification for a particular port type
• Port – a single endpoint defined as a combination of
a binding and a network address
• Service – a collection of named ports, each
associated with a binding and a network address
DBI 2007
HUJI-CS
52
Putting it together
• A client uses the wsdl to guide
the creation of the body of the
soap message
• The header of the soap
message is primarily used to
add additional protocol
information
Service Registry
WSDL for
Service X
– For example, the wsdl does
not tell us where to send the
reply
– So far it does not tell us about
security or reliability
requirements or other policy
issues
1
2
3
Service
X
message
Client
4
reply
DBI 2007
HUJI-CS
53
Really Simple Syndication
What is RSS?
• RSS is used for effectively publishing headlines
and frequently updated content
• RSS files (also called RSS feeds) are XML that
conform to a very simple schema
• Publishers make the RSS feed available on the
Web
– ynet: http://www.ynet.co.il/Integration/StoryRss2.xml
– cnn: http://rss.cnn.com/rss/cnn_topstories.rss
– Intel products: http://rss.intel.com/rss/intel-products.xml
• RSS readers are responsible for being updated
– That is, have the most recent copy of the feed
DBI 2007
HUJI-CS
55
So Why RSS?
• A standard, unified way of distributing headlines
– Application readers need only to know the feed URL
– Easy to query (“anything new about the middle east?”)
and integrate news from multiple sources
• Efficiency: RSS feeds typically contain a small
fragment of text for each news item
– Thus, a lot of traffic is saved
– Compare it to downloading the Web page of the
publishing company
DBI 2007
HUJI-CS
56
Mozilla’s Reader
DBI 2007
HUJI-CS
57
Goggle’s Reader
DBI 2007
HUJI-CS
58
Example: Ynet Feed
<?xml version="1.0" encoding="Windows-1255"?>
<rss version="2.0">
<channel>
<title>ynet - Updates for RSS</title>
<link>http://www.ynetnews.com/home/0,7340,L-3254,00.html</link>
<description></description>
<copyright>Ynet - news and content from Israel (Yedioth Ahronoth web site)</copyright>
<language> en </language>
<pubDate>Sun, 15 Apr 2007 00:03:31 +0200</pubDate>
<lastBuildDate> Sun, 15 Apr 2007 00:03:31 +0200 </lastBuildDate>
<image>
<title>Ynet</title>
<link>http://www.ynetnews.com/home/0,7340,L-3254,00.html</link>
<url>http://www.ynetnews.com/images/ECENTRAL_logo.gif</url>
</image>
DBI 2007
HUJI-CS
59
Example: Ynet Feed (cont’d)
<item>
<category>Updates</category>
<title>Egypt pours cold water on talk of "Negotiations" </title>
<description></description>
<link>http://www.ynetnews.com/articles/0,7340,L-3387877,00.html</link>
<pubDate>Sat, 14 Apr 2007 23:51:24 +0200</pubDate>
<guid>http://www.ynetnews.com/articles/0,7340,L-3387877,00.html</guid>
</item>
<item>
<category>Updates</category>
<title>US: N. Korea must immediately invite IAEA inspectors</title>
<description></description>
<link>http://www.ynetnews.com/articles/0,7340,L-3387866,00.html</link>
<pubDate>Sat, 14 Apr 2007 22:30:39 +0200</pubDate>
<guid>http://www.ynetnews.com/articles/0,7340,L-3387866,00.html</guid>
</item>
<item> …
DBI 2007
HUJI-CS
60
The Channel Element
• This element represents the feed itself
• A channel contains item elements and, in
addition, other elements that describe the feed
• Three sub-elements are required title, link
and description
• The channel of the previous example had also an
image and a language sub-elements
DBI 2007
HUJI-CS
61
The item Element
• Each item element defines one news item
• An item has three mandatory sub-elements:
– The title of the item
– A description of the item
– A link (usually, points to a Web interface of the item)
• Optional sub-elements:
– pubDate – date of publication
– comments – a link to comments about the item
– category
DBI 2007
HUJI-CS
62
Title, Link
Description
DBI 2007
HUJI-CS
63
Resource Description Framework
The Semantic Web Vision
• The vision of the semantic-Web activity is that
Web data will entail the semantics of data in a
manner that is understood (and can be
processed) automatically by computers
– Common formats
– Documents integrate data from diverse resources
(rather than invent their own specific objects)
– A language that specifies how the data relates to realworld objects
• Instantiated by developing a variety of languages
and specifications (RDF, SPARQL, OWL, …)
DBI 2007
HUJI-CS
65
What is RDF?
• A part of the semantic-Web activity
• RDF is a general-purpose language for
representing information on the Web
– Specifically, objects and relationships
• Designed to allow computer applications to
process data based on its semantics
– Rather than displaying data to humans (as opposed to
RSS)
• An RDF document is actually a labeled graph that
is represented in XML
– The specific language is called RDF/XML
– W3C recommendation (Feb. 2004)
DBI 2007
HUJI-CS
66
RDF Data
The basic element: Triple (labeled edge)
Subject
RDF document:
edge-labeled graph
predicate
Object
Person#845
address
#1002
street
Herzel
DBI 2007
city
Netanya
HUJI-CS
postalCode
6941
67
The XML Syntax of RDF
John Smith
page.html
John’s Home Page
<?xml version=“1.0”?>
<rdf:RDF
xmlns:rdf=“http://www.w3.org/TR/WD-rdf-syntax#”
xmlns:dc=“http://purl.org/metadata/dublin_core#”>
<rdf:Description about=“page.html”>
<dc:Creator>John Smith</dc:Creator>
<dc:Title>John’s Home Page</dc:Title>
</rdf:Description>
</rdf:RDF>
DBI 2007
HUJI-CS
68
Structured Values
page.html
dc:Creator
dc:Title
John’s Home Page
Name
John Smith
Email
js@corp.com
...
<Description about=“page.html”>
<dc:Creator>
<Description>
<corp:Name>John Smith</corp:Name>
<corp:Email>js@corp.com</corp:Email>
</Description>
</dc:Creator>
<dc:Title>John’s Home Page</dc:Title>
</Description>
</RDF>
DBI 2007
HUJI-CS
69
Dublin Core
• A set of fifteen basic properties for describing
generalized Web resources
• The “obvious” mapping of Dublin Core
properties into RDF properties has not yet
been approved by the Dublin Core initiative,
but is generally a good example
DBI 2007
HUJI-CS
70
Dublin Core
• “Title”: the name given to the resource
• “Creator”: the person or organization primarily
responsible for the resource
• “Subject”: what the resource is about
• “Description”: a description of the content
• “Publisher”: the person or organization
responsible for making the resource available
• “Contributor”: someone who has provided content
to the resource other than the creator
• “Date”: date of creation or publication
DBI 2007
HUJI-CS
71
Dublin Core
• “Type”: type of resource, such as home page, technical
report, novel, photograph…
• “Format”: data format of the resource
• “Identifier”: URL, ISBN number, …
• “Source”: another resource that this resource is derived
from
• “Language”: the language of the content
• “Relation”: another resource and its relationship to this one
• “Coverage”: the portion of time or space described by this
resource (atlases, histories, etc.)
• “Rights”: the intellectual property rights adhering to this
resource, or a pointer to them
DBI 2007
HUJI-CS
72
Concise Introduction to RDF:
Found in www.vanx.org, by
Yuri Khramov, SchemaSoft
Outline
1. Semantic Web Initiative and Metadata
2. Resource Description Framework (RDF)
basics
3. Advanced topics: collections, reification
4. Vocabularies: Dublin Core, RSS,..
5. RDF Schema
6. How to get RDF to work?
7. Conclusion
DBI 2007
HUJI-CS
74
Semantic Web
The Web was built for human consumption, and
although everything on it is machine-readable, this
data is not machine-understandable
Semantic Web -- a web of data that can be
processed directly or indirectly by machines
The solution proposed here is to use metadata to
describe the data contained in the Web
DBI 2007
HUJI-CS
75
RDF Basics
• Resources
• Properties that have Values
• Statement: Resource A has property B with
Value C
B
C
A
DBI 2007
HUJI-CS
76
www.vanx.org/presentations/RDF
Author
Name
Mail address
Yuri
Khramov
DBI 2007
Yurik@schemasoft.com
HUJI-CS
77
Advanced RDF
• Containers: bags, sequences, alternatives
• aboutEach, aboutEachPrefix
• Reification (higher order statements)
• Namespaces and Vocabularies
DBI 2007
HUJI-CS
78
Dublin Core et al.
• Defined as Open Metadata
• Usual “Library Catalog” Elements, like Creator, Title,
Publisher, Date, Language
• Extended by: Source, Relations,Type (what is it – text,
image, software), Format
• URI (Identifier)
• Used for cataloging “Global Web Library”
• Others: RSS (RDF Site Summary) – NetScape,
• PRISM – publishing – Adobe, Quark, ..
• <indecs> - e-business – EU companies
•
RDF mappings for P3P, PICS,…
DBI 2007
HUJI-CS
79
RDF Schema
• Not an XML Schema!
• A “companion” specification for RDF spec
• Class, Type, subClassOf,
• domain, range
• Misc: label, comment, isDefinedBy,etc.
DBI 2007
HUJI-CS
80
Creating RDF documents
• Manually from HTML or “user domain XML”
• With special assisting tools – like Protégé,
Reggie, DC-dot, RDF for XML
• Ideally – with some automated procedure from
HTML/XML documents
• Can we use XSLT there?
DBI 2007
HUJI-CS
81
Can we use RDF now?
• IBM’s Java Central Station (uses RDF)
• Mozilla’s Aurora (RDF-based)
• MUZE DATAX project
DBI 2007
HUJI-CS
82
Download