wiki:rdfhomepage2

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.
  • When working with "Phoogle" (PHP Class for Google Maps) there are some strange errors. This is because it is not the newest Phoogle version.
    When downloading the new version, it works fine.

Changes in the structure of rdfhomepage2

  • [rdfh1] ./homepage.rdf -> [rdfh2] ./vocabulary/rdfhomepage.rdf:
    • [rdfh1] Namespace "hp" renamed to "ns1" (http://km.dfki.de/model/rdfhomepage#)
    • In rdfh2 MyFoafPerson and myOrgPerson become no longer necessary
    • Projects:
      • Structure in rdfh1:
        <hp:inProject>
         <hp:Project>
          <hp:htmlText />
          <hp:next />
         </hp:Project>
        </hp:inProject>
        
        • shortName and other metadata can be found in the OrgRep file!
        • the project homepage must be extracted from the OrgRep file, too!
      • Structure in rdfh2:
        <ns1:Project about="uri" />
        // uri is at the same time the rdf-uri and the http-url of the project homepage
        
        <rdf:Description>
         <ns1:inProject about="uri" />
        </rdf:Description>
        
        <rdf:Description about="uri">
         <ns1:htmlText />
         <ns1:shortName />
         <ns1:longName />
        </rdf:Descriotion>
        
        • project homepage is at the same time the rdf-uri (no need of any OrgRep file)
        • shortName/longName can be now found in the rdfhomepage.rdf (no OrgRep file)
        • next becomes unnecessary - without any reason, the order is just fine.
    • Interests: The interests' structure changed very similiar to those of the projects.
      However, in rdfh1 there is an attribute "rdf:label" which is completely MISSING in rdfh2.
      Even in the PHP-Sourcecode there is no hint that there's an interest title intended.
  • [rdfh1] ./foaf.xml -> [rdfh2] ./vocabulary/foaf.rdf
    There is a GUI for uploading your rdfh1 foaf file and automatically convert it to valid rdf.
  • [rdfh1] ./ss_bib.rdf -> [rdfh2] ./vocabulary/bibtex.rdf
    These files are completely compatible, however rdfh2 keeps getting problems with the extraction of the dates of articles.

Including the content from rdfh1 into rdfh2

  • 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.
  • However, if we want the style of rdfhomepage2 to be like the one of rdfhomepage1, we need to do that manually, because the namespaces in the css files do not match plus the rdfhomepage2 has another HTML-structure.
  • At the page "People I know" there is shown the "collabarating" and "working" section although there are no entries. Fixed that.
  • The images of friends on rdfhomepage have different sizes, which can be very noisy. Changed to 60x80.
  • Another task is to extract the content from the old rdfhomepage to the new rdfhomepage2 (like shortBio etc.).
    Yet there is no easy way to do this, a program will have to extract the data from rdfhomepage1 and import it directly in rdfhomepage.rdf of rdfhomepage2.
  • This program is called the "rdfhomepage1-Migrater" and can be found in the "migrateRDFHomepage1.php". It asks the user for the homepage.rdf file from the old rdfh1 and extracts the texts from it. Yet there is no implementation for advanced metadata, like the project's name, because this data is located in the OrgRep file, which is not supported *yet*.
  • The "rdfhomepage1-Migrater" can be found on the main page of the Toolbox, when clicking on "Migrate" now
  • rdfh2 does not support interest titles (although it is in the homepage.rdf in rdfh1)

Adapting the Stylesheet from rdfh1 to rdfh2

If we want to have the old rdfh1 style included in the new rdfh2, it won't work just to copy and paste the .css file from one to the other.
In rdfh2 there are different class names and the HTML-structure is very different.
To archive the old style it is necessary to copy font and colors etc. by hand.

Recent changes and addings in rdfh2

  • Added: Create VCard from your FoaF-file (./toolbox/createVCardFromFoaF.php)
    Automatically creates a VCard from the information found in your FoaF-file
  • Added: rdfhomepage1-Migrater (./toolbox/migrateRDFHomepage1.php)
    Extracts valuable information from the homepage.rdf of rdfh1 and generates a filled out formular to insert the data in rdfh2.
    Changes to this informations are up to the user.
  • Added: Content-Cacher (./toolbox/cacheContent.php)
    When there is no cache already, it can take a while until some page has rendered.
    We don't want a visitor of the site to have those long loading times, so it's a good idea to have a button which does the caching for us as a first thing.
  • Modified: The style of rdfh2 now looks more like the old rdfh1 style (kind of).
  • Modified: Warnings on the homepage for missing files like the foaf.xml are now disabled (the site will now 'work' without any data)
  • Modified: The logo on the homepage title is now by default turned off
Last modified 14 years ago Last modified on 07/29/10 20:03:50