@prefix : <#> . @prefix rdf: . @prefix rdfs: . @prefix log: . @prefix string: . @prefix dc: . @prefix foaf: . @prefix home: . @prefix bio: . <> dc:description """Converts an HomepageN3 file into XHTML using a bit of CWM magic. To run it, use: cwm.py home.n3 hometoxhtml.n3 --think --strings > home.html """@en; rdf:seeAlso ; rdf:seeAlso . a home:HomePage . ## Get the semantics of the TargetDocument { ?x a :TargetDocument; log:semantics ?sema } => { ?sema a :Target } . # or, scrape the semantics into the current document (seems to exclude rules):- { ?x a :TargetDocument; log:semantics ?sema . ?sema log:includes { :s :p :o } } => { :s :p :o } . # Put out the header # { ?homepage a home:HomePage; dc:title ?title . ("""\n \n""" ?title """\n \n\n

""" ?title """

""") string:concatenation ?o . } => { :o0 log:outputString ?o } . # One line biography # { ?p a foaf:Person; foaf:mbox ; bio:olb ?olb . ("""\n

""" ?olb """

""") string:concatenation ?o . } => { :o1 log:outputString ?o } . # Date and place of birth # { ?p a foaf:Person; foaf:mbox . ?p bio:event ?e . ?e a bio:Birth; bio:place ?place; bio:date ?date . ("""\n

Born in """ ?place " on " ?date """

""") string:concatenation ?o . } => { :o1a log:outputString ?o } . # Contact # { home:contact ?c } => { ?o1a log:outputString ?c } . # Weblogs # :o2 log:outputString """\n

Weblogs

\n
    """ . { ?p a foaf:Person; foaf:mbox ; foaf:weblog ?w. ("""\n
  • """ """""" ?w.dc:title """ — """ ?w.dc:description """
  • """) string:concatenation ?o . } => { :o3 log:outputString ?o } . :o4 log:outputString """\n
""" . # Interests # :o5 log:outputString """\n

Things I like or I am interested in

\n
    """ . { ?p a foaf:Person; foaf:mbox ; foaf:interest ?i . ("""\n
  • """ """""" ?i.dc:title """ — """ ?i.dc:description """
  • """) string:concatenation ?o . } => { :o6 log:outputString ?o } . :o7 log:outputString """\n
""" . # People I know # :o8 log:outputString """\n

People I know

who have Web presence

\n
    """ . { ?p a foaf:Person; foaf:mbox ; foaf:knows ?person . ("""\n
  • """ """""" ?person.foaf:name """""" """
  • """) string:concatenation ?o . } => { :o9 log:outputString ?o } . :o99 log:outputString """\n
""" . # Colophon # { home:colophon ?c } => { ?o999 log:outputString ?c } . # EOF :o9999 log:outputString """\n\n\n""" . log:implies a log:Chaff .