RDF Application Example 1

Source: Internet
Author: User

 

Go

Http://www.seasr.org/wp-content/plugins/meandre/rdfapi-php/doc/index.html

Download an rdf api for PHP and decompress it to the directory.

E:/siren/rdfapi-PHP

This instance outputs the existing RDF file ..

My directory contains example1.rdf

The content is as follows:

<? XML version = "1.0"?>
<RDF: RDF
XML: base = "http://www.w3.org/Home/Lassila.rdf"
Xmlns: RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns"
Xmlns: DC = "http://purl.org/dc/elements/1.1"
Xmlns: Ex = "http://example.org/stuff/1.0"
Xmlns: S = "http://description.org/schema/">
<RDF: Description
RDF: About = "http://www.w3.org/Home/Lassila">
<S: Creator>
<RDF: Description RDF: nodeid = "b85740">
<RDF: Type
RDF: Resource = "http://description.org/schema/Person"/>
<Ex: Name
RDF: datatype = "http://www.w3.org/TR/xmlschema-2#string"> ora
Lassila </EX: Name>
<Ex: email> lassila@w3.org </EX: email>
</RDF: Description>
</S: Creator>
</RDF: Description>
</RDF: RDF>

 

 

PHPProgramAs follows:

<? PHP

/**
* @ Author [person]
* @ Date 2010/6/1/
*@
*
*/
Define ("rdfapi_include_dir", "E:/siren/rdfapi-PHP/API /");
Include (rdfapi_include_dir. "rdfapi. php ");

// File name
$ Base = "example1.rdf ";

// Create an instance
$ Model = modelfactory: getdefaultmodel ();

// Load the file
$ Model-> load ($ base );

// Output html
$ Model-> writeashtmltable ();

?>

 

Run the command to view the output result.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.