RDF
[ class tree: RDF ] [ index: RDF ] [ all elements ]

Source for file test_SerializerOptions.php

Documentation is available at test_SerializerOptions.php

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4.     <title>Test Serializer Options</title>
  5. </head>
  6. <body>
  7.  
  8. <?php
  9. require_once 'RDF.php';
  10. require_once 'RDF/Model/Memory.php';
  11. // Filename of an RDf document
  12. $base "Example1.rdf";
  13. // Create a new Model_Memory
  14. $model =new RDF_Model_Memory();
  15. // Load and parse document
  16. $model->load($base);
  17. // Output model as HTML table
  18. $model->writeAsHtmlTable();
  19. echo "<P>"
  20. // Create Serializer and serialize model to RDF with default configuration
  21. $ser =new RDF_Serializer();
  22. $rdf =$ser->serialize($model);
  23. echo "<p><textarea cols='110' rows='20'>" $rdf "</textarea>";
  24. // Serialize model to RDF using attributes
  25. $ser->configUseAttributes(true);
  26. $rdf =$ser->serialize($model);
  27. echo "<p><textarea cols='110' rows='20'>" $rdf "</textarea>";
  28. $ser->configUseAttributes(false)
  29. // Serialize model to RDF using entities
  30. $ser->configUseEntities(true);
  31. $rdf =$ser->serialize($model);
  32. echo "<p><textarea cols='110' rows='30'>" $rdf "</textarea>";
  33. $ser->configUseEntities(false);
  34.  
  35. ?>
  36.  
  37. </body>
  38. </html>

Documentation generated on Mon, 11 Mar 2019 15:39:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.