Go Back   DevHunters.com l Webmaster Forum - Web Advertising - Web Design - SEO Forums > Find a Webmaster / Web Developer / Job Requests > Webmaster Discussion

Webmaster Discussion This is a general webmaster disussion board! No Advertising Allowed!

Reply
 
LinkBack Thread Tools Display Modes
Old 10-24-2008, 03:31 PM   #1 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default The Semantic Web & XHTML+RDFa

On 16 October 2008 the W3C announced XHTML+RDFa as a recommendation. IMO this is an important milestone in the process of implementing the Semantic Web. The Doctype/DTD is now cataloged and usable by the W3C Markup Validator.

By way of example of the use of basic constructs and syntax, I have composed a validated XHTML+RDFa page -- just general information for those who might be interested in the development of the Semantic Web.

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 10-24-2008, 04:44 PM   #2 (permalink)
Senior Staff
 
Hunter1's Avatar
 
7up Pinball Champion! Baccarat Champion! Chingy Powerballin Champion!
Join Date: Mar 2007
Location: Indiana USA
Posts: 2,296
Hunter Bux: 18,026.33
Hunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud ofHunter1 has much to be proud of
iTrader: (9)
Default

I have been following this a bit as well.

This new system will make older sites that have outdated coding become up to date with very little work. There are a lot of sites out there that would like to enjoy the modern reading of their code but they do not have the option to change or update their script but this will change that.

There are also some downfalls that I can see from this but we will see here very soon what the effects and possibilities are going to be.

Good post!
Hunter1 is offline   Reply With Quote
Old 10-25-2008, 04:09 PM   #3 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Thumbs up

Quote:
Originally Posted by Hunter1 View Post
I have been following this a bit as well.

This new system will make older sites that have outdated coding become up to date with very little work. There are a lot of sites out there that would like to enjoy the modern reading of their code but they do not have the option to change or update their script but this will change that.

There are also some downfalls that I can see from this but we will see here very soon what the effects and possibilities are going to be.

Good post!
Great post James!

Hunter, reading the post I thought straight away to modify my site's markup to XHTML+RDFa. Wouldn't that be a good idea? Which are the downfalls?
Webnauts is offline   Reply With Quote
Old 10-25-2008, 07:16 PM   #4 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Quote:
Originally Posted by Webnauts View Post
Great post James!
Thanks, Webnauts.

Quote:
.......... I thought straight away to modify my site's markup to XHTML+RDFa. Wouldn't that be a good idea? Which are the downfalls?
If I may interject .......... I don't think it would be a good idea at this time. There is a big learning curve involved in using XHTML+RDFa in a practical way. I suggest you start off reading the RDF references in my Semantic Web sidngture link and especially RDFa in XHTML: Syntax and Processing -- the concepts are pretty complicated and you may have to re-read it a couple of times before you do full incorporation. But, it will be a good exercise because the Semantic Web is the next major development IMO.

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 10-25-2008, 07:26 PM   #5 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

BTW, if you would like to see Triples and Graphs (and source code) used in conjunction with RDF/XML (referenced in the W3C XHTML+RDF link in my previous post) depicted go to this W3C Validation result

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 10-25-2008, 07:37 PM   #6 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Red face XHTML+RDFa

James I think I was too quick. I began implementing it on my web site.

I know I have to read the documentation and implement several stuff, but for a start I just added on my all my pages the following PHP script, taking care of the HTML (ascii) codes of my pages:

<?php
$charset = "utf-8";
$mime = "text/html";

function fix_code($buffer) {
return (str_replace(" />", ">", $buffer));
}

if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
# if there's a Q value for "application/xhtml+xml" then also
# retrieve the Q value for "text/html"
if(preg_match("/application\/xhtml\+xml;q=0(\.[1-9]+)/i",
$_SERVER["HTTP_ACCEPT"], $matches)) {
$xhtml_q = $matches[1];
if(preg_match("/text\/html;q=0(\.[1-9]+)/i",
$_SERVER["HTTP_ACCEPT"], $matches)) {
$html_q = $matches[1];
# if the Q value for XHTML is greater than or equal to that
# for HTML then use the "application/xhtml+xml" mimetype
if($xhtml_q >= $html_q) {
$mime = "application/xhtml+xml";
}
}
# if there was no Q value, then just use the
# "application/xhtml+xml" mimetype
} else {
$mime = "application/xhtml+xml";
}
}

# special check for the W3C_Validator
if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
$mime = "application/xhtml+xml";
}

# set the prolog_type according to the mime type which was determined
if($mime == "application/xhtml+xml") {
$prolog_type = "<?xml version='1.0' encoding='$charset'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0' xml:lang='en'>";
} else {
ob_start("fix_code");
$prolog_type = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>";
}
# finally, output the mime type and prolog type
header("Content-Type: $mime;charset=$charset");
header("Vary: Accept");
print $prolog_type;
?>

I tested already with diverse browsers and I have not noticed any compatibility issues. Do you think that what I am doing would harm in any way?
Webnauts is offline   Reply With Quote
Old 10-25-2008, 07:58 PM   #7 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Quote:
Originally Posted by Webnauts View Post
James I think I was too quick. I began implementing it on my web site.

I know I have to read the documentation and implement several stuff, but for a start I just added on my all my pages the following PHP script, taking care of the HTML (ascii) codes of my pages .......... I tested already with diverse browsers and I have not noticed any compatibility issues. Do you think that what I am doing would harm in any way?
Not at all, Webnauts -- great job! (Valid XHTML+RDFa too!)

(Of course you don't have any RDFa syntax added yet)

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS

Last edited by jamesicus; 10-25-2008 at 08:01 PM. Reason: added forgotten text
jamesicus is offline   Reply With Quote
Old 10-25-2008, 08:13 PM   #8 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Default

Quote:
Originally Posted by jamesicus View Post
Not at all, Webnauts -- great job! (Valid XHTML+RDFa too!)
Great!


Quote:
Originally Posted by jamesicus View Post
(Of course you don't have any RDFa syntax added yet)
You are right. That is the next step.

Thanks, John :)
Webnauts is offline   Reply With Quote
Old 10-25-2008, 08:51 PM   #9 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Question

James I have a question. I do not use for my "h1" tags the "title" tags content.

I have for example the title "SEO Workers - Search Engine Optimization Consulting Company" and for the h1 tag "SEO & Custom Web Design Experts for Better Search Engine Rankings"


Since I wanted to add a property to my h1 tag, I guess I need to add a meta tag for s dc.title.

What should I use there for the property? The content of my "title" or of the "h1" tag?
Webnauts is offline   Reply With Quote
Old 10-25-2008, 11:17 PM   #10 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Quote:
Originally Posted by Webnauts View Post
James I have a question. I do not use for my "h1" tags the "title" tags content.

I have for example the title "SEO Workers - Search Engine Optimization Consulting Company" and for the h1 tag "SEO & Custom Web Design Experts for Better Search Engine Rankings"


Since I wanted to add a property to my h1 tag, I guess I need to add a meta tag for s dc.title.

What should I use there for the property? The content of my "title" or of the "h1" tag?
Check out Dublin Core (DC) Metadata Element Set first, John.

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 10-25-2008, 11:52 PM   #11 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Default

I checked Dublin core. Thanks James.

I guess I have one very last question that is giving me a headache:

http://www.w3.org/2005/08/online_xsl...eoworkers.com/

I get an error: unparseable - text/plain not visibly XML. Can you tell what that can be?
Webnauts is offline   Reply With Quote
Old 10-31-2008, 10:00 AM   #12 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Default

Do you think you can help me with a php script, since I can't get mine working properly?
Webnauts is offline   Reply With Quote
Old 11-03-2008, 11:27 PM   #13 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Sorry I didn't get back to you sooner, Webnauts. I will have to study your page further.

Webnauts and Hunter1: Thanks. I composed this page to illustrate the use of the XHTML+RDFa Doctype/DTD, and the syntax of three primary RDFa elements: | about | property | typeof | together with an example FOAF (Friend Of A Friend) and Creative Commons constructs -- for those who might want to experiment with creating XHTML+RDFa pages after reading the W3C RDFa Primer and RDFa recommendation RDFa in XHTML: Syntax and Processing.

This is actually my own attempt to understand how XHTML+RDFa documents are constructed and function.

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 11-03-2008, 11:35 PM   #14 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Default

Quote:
Originally Posted by jamesicus View Post
Sorry I didn't get back to you sooner, Webnauts. I will have to study your page further.

Webnauts and Hunter1: Thanks. I composed this page to illustrate the use of the XHTML+RDFa Doctype/DTD, and the syntax of three primary RDFa elements: | about | property | typeof | together with an example FOAF (Friend Of A Friend) and Creative Commons constructs -- for those who might want to experiment with creating XHTML+RDFa pages after reading the W3C RDFa Primer and RDFa recommendation RDFa in XHTML: Syntax and Processing.

This is actually my own attempt to understand how XHTML+RDFa documents are constructed and function.

James
Hi James,

I switched back to XHMTL Strict because I could not get my PHP parser working correctly.

If I had an appropriate functional parser, I would not have had to change back. I know already the above you have mentioned FOAF, etc).

Do you think you could share the parser script? I would even pay a fee.

Thanks a lot in advance,

John
Webnauts is offline   Reply With Quote
Old 11-04-2008, 12:04 AM   #15 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Quote:
Originally Posted by Webnauts View Post
.......... I switched back to XHMTL Strict because I could not get my PHP parser working correctly .......... Do you think you could share the parser script? I would even pay a fee ..........
I don't know what you mean by "parser script", John. I will be happy to share any coding, scripts, etc. -- no charge of course.

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 11-04-2008, 12:14 AM   #16 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Default

The PHP script I am about is for serving up XHTML with the correct MIME type, and being cross browser compatible.

This one did not do the work as it should so far :

<?php
$charset = "utf-8";
$mime = "text/html;";

function fix_code($buffer) {
return (str_replace(" />", ">", $buffer));
}

if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
# if there's a Q value for "application/xhtml+xml" then also
# retrieve the Q value for "text/html"
if(preg_match("/application\/xhtml\+xml;q=0(\.[1-9]+)/i",
$_SERVER["HTTP_ACCEPT"], $matches)) {
$xhtml_q = $matches[1];
if(preg_match("/text\/html;q=0(\.[1-9]+)/i",
$_SERVER["HTTP_ACCEPT"], $matches)) {
$html_q = $matches[1];
# if the Q value for XHTML is greater than or equal to that
# for HTML then use the "application/xhtml+xml" mimetype
if($xhtml_q >= $html_q) {
$mime = "application/xhtml+xml";
}
}
# if there was no Q value, then just use the
# "application/xhtml+xml" mimetype
} else {
$mime = "application/xhtml+xml";
}
}

# special check for the W3C_Validator
if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
$mime = "application/xhtml+xml";
}

# set the prolog_type according to the mime type which was determined
if($mime == "application/xhtml+xml") {
$prolog_type = "<?xml version=\"1.0\" encoding=\"$charset\"?>
<?xml-stylesheet type=\"text/xsl\" href=\"/copy.xsl\"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0' xml:lang='en'>";
}
else {
ob_start("fix_code");
$prolog_type = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>";
}
# finally, output the mime type and prolog type
header("Content-Type: $mime;charset=$charset");
header("Vary: Negotiate,Accept,");
print $prolog_type;
?>

I am sure you are using a script for that. Do you understand what I mean?

Thanks James. :)

Last edited by Webnauts; 11-04-2008 at 12:25 AM.
Webnauts is offline   Reply With Quote
Old 11-04-2008, 12:45 AM   #17 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Quote:
Originally Posted by Webnauts View Post
The PHP script I am about is for serving up XHTML with the correct MIME type, and being cross browser compatible .......... Do you understand what I mean? ..........
Ah, yes, John. I use various iterations for serving XHTML via content negotiation. Here is the simple core form for XHTML+RDFa -- modify it as you wish, John.

<?php

# For MSIE browsers
if (stristr($_SERVER["HTTP_USER_AGENT"],"MSIE")) {
$mime = "text/html";
$charset = "utf-8";
$prolog_type = "
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN'
'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0'
xml:lang='en'>";
}

# For other browsers
else {
$mime = "application/xhtml+xml";
$charset = "utf-8";
$prolog_type = "<?xml version='1.0' encoding='$charset'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN'
'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0'
xml:lang='en'>";
}

# Generate the mime type and prolog type
header("Content-Type: $mime; charset=$charset");
header("Vary: Negotiate, Accept");
print $prolog_type;

?>
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 11-04-2008, 01:01 AM   #18 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

John -- or for serving XHTML 1.0 (strict) via content-negotiation:

<?php

# For MSIE browsers
if (stristr($_SERVER["HTTP_USER_AGENT"],"MSIE")) {
$mime = "text/html";
$charset = "utf-8";
$prolog_type = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en-us' lang='en-us'>";
}

# For other browsers
else {
$mime = "application/xhtml+xml";
$charset = "utf-8";
$prolog_type = "<?xml version='1.0' encoding='$charset'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en-us' lang='en-us'>";
}

# Generate the mime type and prolog type
header("Content-Type: $mime; charset=$charset");
header("Vary: Negotiate, Accept");
print $prolog_type;

?>
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote
Old 11-04-2008, 01:32 AM   #19 (permalink)
New Hunter
 

Join Date: Oct 2008
Location: Europe
Posts: 16
Hunter Bux: 0
Webnauts is on a distinguished road
iTrader: (0)
Send a message via Yahoo to Webnauts Send a message via Skype™ to Webnauts
Default

James did anybody ever tell you that you RULE? I assume yes.
But just in case I am wrong, then I must admit that you rule!

Thank you so much for the excellent support! I implemented a test page and it works great!

Please PM me your paypal. I would love to buy you a beer. Or anything else you wish. :)
Webnauts is offline   Reply With Quote
Old 11-04-2008, 09:28 AM   #20 (permalink)
New Hunter
 

Join Date: Oct 2008
Posts: 15
Hunter Bux: 0
jamesicus is on a distinguished road
iTrader: (0)
Send a message via ICQ to jamesicus
Default

Quote:
Originally Posted by Webnauts View Post
.......... I must admit that you rule! ..........
I will read this to my wife and cat -- they don't understand that! :)

Quote:
Please PM me your paypal. I would love to buy you a beer ..........
Thanks, John -- no need for that -- but maybe we will quaff one together some day!

Use Web-Sniffer View HTTP Request and Response Header to check how your pages are being served -- just specify the User-Agent (Browser) you wish to check for and leave everything else at default. Among other things, the content (MIME) type and character encoding will be displayed along with the page source code.

James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout
Serving XHTML - content negotiation/selected content (MIME) type
All pages Interoperable and with Validated Markup/CSS
jamesicus is offline   Reply With Quote