<s> """<STR_LIT>""" <EOL> from rdflib import Graph , RDF , RDFS , Literal <EOL> from rdflib . namespace import FOAF <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> g = Graph ( ) <EOL> bob = g . resource ( '<STR_LIT>' ) <EOL> bob . set ( RDF . type , FOAF . Person ) <EOL> bob . set ( FOAF . name , Literal ( "<STR_LIT>" ) ) <EOL> bill = g . resource ( '<STR_LIT>' ) <EOL> bill . add ( RDF . type , FOAF . Person ) <EOL> bill . add ( RDF . type , FOAF . Agent ) <EOL> bill . set ( RDFS . label , Literal ( "<STR_LIT>" ) ) <EOL> bill . add ( FOAF . knows , bob ) <EOL> print "<STR_LIT>" , bill . value ( FOAF . knows ) . value ( FOAF . name ) <EOL> print "<STR_LIT>" , <EOL> for friend in bill [ FOAF . knows ] : <EOL> print friend [ FOAF . name ] . next ( ) , "<STR_LIT:U+0020>" <EOL> print "<STR_LIT>" , <EOL> for friend in bill [ FOAF . knows / FOAF . name ] : <EOL> print friend <EOL> bill [ RDFS . label ] = Literal ( "<STR_LIT>" ) <EOL> print g . serialize ( format = '<STR_LIT>' ) </s>
