Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once( "sparqllib.php" );
- $db = sparql_connect( 'http://dbpedia.org/sparql' );
- if( !$db )
- { print sparql_errno() . ": " . sparql_error(). "\n"; exit; }
- # Vamos recuperar os URIs dos compositores do barroco
- $myquery = "select ?pessoa, ?nome where {
- ?pessoa dcterms:subject category:Baroque_composers.
- ?pessoa dbpprop:name ?nome.
- }
- ORDER BY ASC(?nome)";
- $result = sparql_query( $myquery );
- if( !$result )
- { print sparql_errno() . ": " . sparql_error(). "\n"; exit; }
- print "<table class='example_table' border='1'>\n";
- print " <tr><th>URI</th></tr>\n";
- while( $row = sparql_fetch_array( $result ) )
- {
- print " <tr><td><a href='composer-pag.php?uri=".$row['pessoa']. "'>".$row['nome']."</a></td></tr>\n";
- }
- print "</table>";
- print "<p>Number of rows: ".sparql_num_rows( $result )." results.</p>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment