Senin, 30 Mei 2011

SMW ♥ 303

How do I know? Here's the clue. Have a look at the log generated by Live HTTP headers (a Firefox add-on) below:

01: http://localhost/wiki/index.php/Special:URIResolver/Mr_X
02:
03: GET /wiki/index.php/Special:URIResolver/Mr_X HTTP/1.1
04: Host: localhost
05: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
06: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
07: Accept-Language: en-gb,en;q=0.5
08: Accept-Encoding: gzip,deflate
09: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
10: Keep-Alive: 65535
11: Connection: keep-alive
12: If-Modified-Since: Mon, 30 May 2011 15:02:24 GMT
13:
14: HTTP/1.1 303 See Other
15: Date: Mon, 30 May 2011 15:08:38 GMT
16: Server: Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
17: X-Powered-By: PHP/5.3.5
18: Vary: Accept-Encoding,Cookie
19: Expires: Thu, 01 Jan 1970 00:00:00 GMT
20: Cache-Control: private, must-revalidate, max-age=0
21: Last-Modified: Mon, 30 May 2011 15:08:38 GMT
22: Location: http://localhost/wiki/index.php/Mr_X
23: Content-Length: 0
24: Keep-Alive: timeout=5, max=100
25: Connection: Keep-Alive
26: Content-Type: text/html; charset=utf-8
27: ----------------------------------------------------------
28: http://localhost/wiki/index.php/Mr_X
29:
30: GET /wiki/index.php/Mr_X HTTP/1.1
31: Host: localhost
32: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17
33: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
34: Accept-Language: en-gb,en;q=0.5
35: Accept-Encoding: gzip,deflate
36: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
37: Keep-Alive: 65535
38: Connection: keep-alive
39:
40: HTTP/1.1 200 OK
41: Date: Mon, 30 May 2011 15:08:38 GMT
42: Server: Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
43: X-Powered-By: PHP/5.3.5
44: Content-Language: en
45: Vary: Accept-Encoding,Cookie
46: Expires: Thu, 01 Jan 1970 00:00:00 GMT
47: Cache-Control: private, must-revalidate, max-age=0
48: Last-Modified: Mon, 30 May 2011 16:30:27 GMT
49: Keep-Alive: timeout=5, max=99
50: Connection: Keep-Alive
51: Transfer-Encoding: chunked
52: Content-Type: text/html; charset=UTF-8
53: ----------------------------------------------------------
view raw 303 @ SMW.txt hosted with ❤ by GitHub

So, what does really happen?
  1. I send a request to dereferencing the resource (any kind of resource) URI  @ line 3. I add a content negoitation stuff on the header like line 6.
  2. The server gives a 303 response (yay!) @ line 14 and because I was asking for text/html content, the server gives a redirection to this location @ line 22.
  3. I send a second request  @ line 30 to get the text/html content (information resource) to the location as specified on the server response.
  4. I got a 200 @ line 40, voila! Now I could read the information describing the resource URI.

Jumat, 20 Mei 2011

Silly Semantic

Just exported this RDF file from my Drupal profile page (localhost) and if you look at it, you'll find out why I called this silly.

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:sioc="http://rdfs.org/sioc/ns#">
<rdf:Description rdf:about="http://localhost/drupal/node/4">
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
<foaf:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Fariz</foaf:name>
<dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-04-06T23:06:09+07:00</dc:date>
<dc:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-04-06T23:06:09+07:00</dc:created>
<dc:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-04-07T18:23:26+07:00</dc:modified>
<sioc:has_creator rdf:resource="http://localhost/drupal/user/1"/>
<sioc:num_replies rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">0</sioc:num_replies>
<foaf:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Dr.</foaf:title>
</rdf:Description>
</rdf:RDF>

Hey guys, I was born on 2011-04-06T23:06:09+07:00! I'm a baby then!

PS: This silliness comes when you mix up the semantic about a document and a thing described by that document.

Semantic Web: Intro

Selasa, 17 Mei 2011

OWLizr - OWLizing Your Text

It's actually the paper I wrote. It's published in ICACSIS 2010. So, here's the abstract:

In this paper we present OWLizr, a system that constructs formal knowledge representations using Web Ontology Language (OWL) from natural language text in bahasa Indonesia. The design of OWLizr is mainly concerned with the representation of knowledge about real-world events using the reification technique. Such knowledge, which is commonplace in naturally occurring texts, is not typically handled by logics for ontologies such as Description Logic. OWLizr consists of four modules: the NLP Semantic Analyzer, KB Generator, KB Reasoner, and SPARQL Query Generator. We also developed an ontology to support the knowledge representation and reasoning process in the KB Generator and KB Reasoner. The NLP Semantic Analyzer reuses the semantic analyzer program developed by Mahendra. Our system supports question-answering (QA) on the knowledge base using the SPARQL Query Generator module.

Download Link

I look forward to develop it again. So, suggestions and comments are welcome!

Rabu, 11 Mei 2011

Semantic Brochure

So, I see this:


So, it's my duty to make the semantic version of it. So, here it is:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix xhv: <http://www.w3.org/1999/xhtml/vocab#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.dhl.com/example.rdf#company> a gr:BusinessEntity ;
gr:legalName "DHL" ;
foaf:depiction <http://www.dhl.com/img/meta/dhl_logo.gif> ;
gr:hasPOS <http://www.dhl.com/example.rdf#store1> .
<http://www.dhl.com/example.rdf#store1> a gr:LocationOfSalesOrServiceProvisioning ;
gr:name "DHL Service Point Pancoran" ;
vcard:adr
[ a vcard:Address ;
vcard:country-name "Indonesia" ;
vcard:locality "Jakarta Selatan" ;
vcard:postal-code "12780" ;
vcard:street-address "Siemens Business Park, Building F, Jl. MT. Haryono Kav. 52-53"
] ;
vcard:tel "021-79178606".
view raw DHL.ttl hosted with ❤ by GitHub