wiki:rdfhomepage2

Version 7 (modified by michael.kraus, 14 years ago) (diff)

--

rdfhomepage2

As his master's thesis, Andrew Buttigieg did a great job in enhancing the rdfhomepage to make it more user friendly (for the homepage's author). The idea was to cut the monolithic PHP monster into a more modular shape and adding user interfaces ("rdfhomepage toolbox") to make editing and simple adaptions of the look and feel easy.

Ideas and discussions can be found in the rdfhomepage forum: https://rdfhomepage.opendfki.de/forum/showthread.php?tid=21

State after the thesis

Andrew spend a lot of time on adding new features but had to change many old sources by rewritting better ones from scratch. The result was a real branch from the old rdfhomepage - to be found in trunk/rdfhomepage2.

Problems:

  • rdfhomepage2 works fine, however, the old rdfhomepage user's are still using the old rdfhomepage sources.
  • There is no easy migration for bringing "old rdfhomepage" to the new "rdfhomepage2".
  • The Installation of rdfhomepage2 works much better than the installation of the old rdfhomepage, however, there are still errors and warnings coming up after/during the "installation" of rdfhomepage2.

Next goals in 2010

Now, Michael Kraus invests 4 weeks of his time to solve the above mentioned problems.

To do:

  1. First migration of old rdfh to new rdfh2
    • Try to migrate Sven's homepage (old rdfh) to the new rdfh2
    • Eliminate upcoming errors in warning while migrating
    • Maybe write some "install script" or something alike
  2. Set up a completely new rdfh2 (no data at the beginning)
    • Download rdfh2 sources to some place
    • Start "install script" (if available)
    • Incrementally(!) add new data until the homepage is more or less "complete"
    • Eliminate upcoming errors in warning while migrating
    • Maybe adapt the "install script"
    • Set up other rdfh2 instances... until this process works without any erros

From a downloaded rdfhomepage2-package to a working installation

These are the problems that occured and the ways how to solve them:

  • Checkout the rdfhomepage2 package to a folder of your choice
  • While first running the following error occurs:
    Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in rdfhomepage2/rdfapi-php-0.95/api/ontModel/RdfsVocabulary.php on line 127
  • Cause: On line 127 there is a function named „NAMESPACE“ declared. This is an illegal name for a function since PHP 5.3
  • Solution: Change the function's name to „RDFHNAMESPACE“, and every call of it in every PHP-script!
    Python Script for this task (execute only ONCE) :
    import os
    import re
    
    startdir = "/opt/lampp/htdocs/rdfhomepage2/"
    for root, dirs, files in os.walk(startdir):
        for file in files:
            if file[-4:] == ".php":
                fopen = open(root+"/"+file,"r")
                read = fopen.read()
                oldread = read
                read = re.sub("([\W])*NAMESPACE[\W]*\([\W]*\)",r"\1"+"RDFHNAMESPACE()",read)
                fopen.close()
                if read != oldread:
                    fopen = open(root+"/"+file,"w")
                    fopen.write(read)
                    fopen.close() 
                    print root+"/"+file
    
    
  • Now the rdfhomepage2 is on the screen, although there are some errors
  • Start with the first ones:
    Permission denied / Operation not permitted - a look in the sourcecode (index.php) shows, that chmod() gets called with every single execution of the script.
    This section gets deleted: The folders it should create will be a prerequisite in the installation instructions later on.
    All these folders exist within the download package but "cache/".
  • Create the folder "cache/" manually for now. Later it will be in the download-package included.
  • Same as above with the folder "cache/vocabulary/" (Create it manually)
  • On the left in the little box which says "My recent blogs" we have 4 errors, the sourcecode (blog.php) shows that the script tries to create a file.
    No permissions. Adjust the rights of the whole rdfhomepage2 folder.
  • 1 Error survives: Warning: closedir() [function.closedir]: 80 is not a valid Directory resource in /rdfhomepage2/blog.php on line 118
    Solution: First fopen(), then closedir() on the same variable. Replace closedir() with fclose().
  • All PHP-Errors are fixed now. But because we have no content yet, there are some more errors:
    vocabulary/vcard.rdf does not exist. You need to use your editor to create this file.
    vocabulary/rdfhomepage.rdf does not exist. You need to use your editor to create this file.
    vocabulary/foaf.rdf does not exist. You need to use your editor to create this file.
    These errors will fix theirselves while inserting your data into the rdfhomepage2.
  • To import your existing FOAF-file into rdfhomepage2, click at the RDFHomepage Toolbox on "FOAF", then select "Import FOAF", choose your foaf.xml and press "Upload".
  • Your friends will be shown on your rdfhomepage2 now: The first time loading, might take a minute or two, then it's cached.
  • There are usually informations like your name, your phone number etc. in your FOAF file, however, rdfhomepage2 does not yet automatically create a VCard from this information.
  • Added a new option "Create VCard from FOAF" to "toolbox/indexFoaFEditor.php" which redirects to a new file: "createVCardFromFoaf.php"
  • So far we managed to include the content from the old (rdfh1) FoaF-file into rdfh2. Now we will try to import the bibtex file:
    On the main page, click on "Publications", then choose "Upload Publications" and select your bibtex file!
    There is a new option: "Convert to RDF". This step is important for you publications to show on your rdfhomepage. Click it.
  • On the rdfhomepage you can now click on "Publications". The site may load quite a long time once(!). Now the content is cached. Try again to call your Publications.