Load a Local .owl file: EasyRdf_Graph

420 views
Skip to first unread message

Zeyneb Tadjine

unread,
Mar 1, 2016, 8:04:06 AM3/1/16
to EasyRdf Discussion
Hello everyone, 

I am new in the web semantic world, and I find some difficulties loading my ontology using easyrdf: 

I have followed the example they provided in their website (the very basic way!): 


$foaf = new EasyRdf_Graph("http://njh.me/foaf.rdf");
$foaf->load();
$me = $foaf->primaryTopic();
echo "My name is: ".$me->get('foaf:name')."\n";

 It is working very well, but as soon as I try to load information from my local file, which is an .owl created with protégé I have the following error: 

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'EasyRdf_Http_Client only supports the 'http' and 'https' schemes.' in C:\wamp\www\Design\vendor\easyrdf\easyrdf\lib\EasyRdf\Http\Client.php on line 134

InvalidArgumentException: EasyRdf_Http_Client only supports the 'http' and 'https' schemes. in C:\wamp\www\Design\vendor\easyrdf\easyrdf\lib\EasyRdf\Http\Client.php on line 134

Do you have please any solution to load owl files.. ( I am not using RDF directly because I need the "functional properties" declarations, unfortunately I can(t do that with only rdf syntax.

Thanks for your help :)

Zeyneb  

Nicholas J Humfrey

unread,
Mar 1, 2016, 8:10:18 AM3/1/16
to eas...@googlegroups.com
Hello Zeyneb,

Were you using a file:// URL?

To load a file from the filesystem, then you have to use the parseFile()
function:

$graph = new EasyRdf_Graph();
$graph->parseFile("myfile.rdf");

See the documentation here:
http://www.easyrdf.org/docs/api/EasyRdf_Graph.html


Although note that EasyRDF only supports RDF triple based formats and
not OWL 2 XML.


nick.




Were you using On 2016-03-01 10:49, Zeyneb Tadjine wrote:
> Hello everyone,
>
> I am new in the web semantic world, and I find some difficulties
> loading my ontology using easyrdf:
>
> I have followed the example they provided in their website (the very
> basic way!):
>
> $foaf = new EasyRdf_Graph("http://njh.me/foaf.rdf");
> $foaf->load();
> $me = $foaf->primaryTopic();
> echo "My name is: ".$me->get('foaf:name')."\n";
>
> It is working very well, but as soon as I try to load information
> from my local file, which is an .owl created with protégé I have the
> following error:
>
> _Fatal error: Uncaught exception 'InvalidArgumentException' with
> message 'EasyRdf_Http_Client only supports the 'http' and 'https'
> schemes.' in
> C:\wamp\www\Design\vendor\easyrdf\easyrdf\lib\EasyRdf\Http\Client.php
> on line 134_
>
> INVALIDARGUMENTEXCEPTION: EASYRDF_HTTP_CLIENT ONLY SUPPORTS THE
> 'HTTP' AND 'HTTPS' SCHEMES. IN
> C:\WAMP\WWW\DESIGN\VENDOR\EASYRDF\EASYRDF\LIB\EASYRDF\HTTP\CLIENT.PHP
> ON LINE 134
>
> Do you have please any solution to load owl files.. ( I am not using
> RDF directly because I need the "functional properties" declarations,
> unfortunately I can(t do that with only rdf syntax.
>
> Thanks for your help :)
>
> Zeyneb
>
> --
> You received this message because you are subscribed to the Google
> Groups "EasyRdf Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to easyrdf+u...@googlegroups.com.
> To post to this group, send email to eas...@googlegroups.com.
> Visit this group at https://groups.google.com/group/easyrdf.
> For more options, visit https://groups.google.com/d/optout.

Rabia Majeed

unread,
Nov 8, 2017, 5:47:13 PM11/8/17
to EasyRdf Discussion
i got this error after using graph function for local rdf file
$graph = new EasyRdf_Graph(); 
     $graph->parseFile("faculty.rdf"); 
$graph->load();
$me = $graph->primaryTopic();
echo "My name is: ".$me->get('fd:name')."\n";

Mohit Nagpal

unread,
Oct 29, 2018, 7:53:29 AM10/29/18
to EasyRdf Discussion
Hello Nicholas,

I tried the solution you gave. But unfortunately, the primaryTopic() method now returns Null, making get() method useless. 

P.S. I am trying to use your "foaf.rdf" file from my system.

Looking forward to a solution from you.

Regards
Mohit Nagpal 
Reply all
Reply to author
Forward
0 new messages