What is the best way to explore a hierarchical folder structure?

Hallo,
I need to access and navigate a hierarchical folder structure hosted in a MS SQL Server database. In particular there is a root folder containing several folders. Each child-folder contains further nested folders or documents.
For each item I need to retrieve the folder's (name, path, etc) and the documents (title, author, etc.) details that are retrievable from the DB fields. Afterwards I will use these data to create a semantic web ontology using Jena API.
My question was about which is the best way to proceed.
A collegue of mine suggested to use the "WITH" command of SQL Server to create and use a link list to navigate easily the structure, executing just one query rather than several (one for each level of the nested loops). However in this way the solution will work only with the SMQ Server database, while my goal is to achieve a more general solution.
May someone help me?
Thank you in advance,
Francesco

My goal is to create a documents library ontology achieving, from each element of the hierarchy (folder or document), some data (title, parent, etc.) and use them to "label" the ontology resources.
I will use a little of both approches in the following way:
1) I make just ONE query on folder table to get, from each folder, its path (eg. root/fold1/fold2/doc1.pdf), its ID and ParentID and ONE on the Documents table to get the containerID, title, etc.
2) I create as many Folder objects as the retrieved records and an HashTable, where the KEY = Folder.ParentID value and the VALUE = Vector<Folder>. I add then each object to the Vector relative to the same ParentID. In this way I have an Vector containing all the folders child of the same parent folder and I do the same for an HashTable keeping the documents contained in a specific folder.
3)I extract from the HashTable the root folder (whose ParentID is always "0" and whose ID is "1") than it is invoked the method appendChild() (see code)
     public static void appendChild(int ID, Resource RES)
          Vector<Folder> currFold = table.get(ID);
          for(int i=0; i<currFold.size(); i++)
               //Extract the child and crate the relative resource
               if(table.containsKey(currFold.getID()))
                    appendChild(currFold[i].getID(), Resource newRES);
In this way I go in depth in the hirarchical structure using a "left most" procedure. I made a test and the output is correct. However, such an approch must be done for about 4 level depth folders (around 30 in total) containing also documents and creating the documents library of a Project. Then I must process around 20 project to achieve for all of them such a documents library representation.
By the way, I do not have to mantein the HashTable content after I created the docs library ontology. Hence I use just one hashTable for ALL the projects and I flush it after I finish to do the loop for one project in order to save resources.
My question is: is right my approach or might I improve it in some way?
Thank you for every suggesion/comment.
Francesco
Edited by: paquito81 on May 27, 2008 8:15 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • What data does SNMP return and what is the best way to explore it?

    Hi All
    I have some queries about using SNMP on Cisco devices.
    1. What is the best way to get an idea of what data MIBs can return?
    I have entered the commmand "show snmp mib". However, the number of MIBs generated is huge!
    2. Can you enter a command on the Cisco device itself that returns snmp data?
    e.g. if I want to see what data a MIB entry returns, can I interrogate it on the Cisco device itself rather than having to rely on network management software?
    The reason I ask is that we are currently looking for Network Management Software. However, I have no idea what data SNMP can return, therefore don't know if what the Management Software offers is comprehensive or not.
    Any suggestions on how best to get an idea the data SNMP can generate plus any other suggestions are very welcome!
    Thanks
    John

    Generally speaking, snmp can query about any parameter of the system. An enterprise class device has almost all conceivable parameters instrumented thus. A device's inventory (chassis, cards, ports, power supplies, software image, etc.) and the state of its interfaces and traffic they are carrying are among the primary ones.
    You can query a device's snmp variables remotely "by hand" using an open source distribution of a tool like snmpwalk. You need to know what you're looking for - i.e., the exact oid (object ID) string or else you get a long reply like you alluded to. It also helps to have the actual MIB you are querying against locally so that the output you get will be human-readable. Otherwise you'll get long numeric strings (the snmp oid) followed by alphanumeric values which may or may not make sense at first glance depending on the oid being queried. A MIB's purpose is to add that abstraction layer / interpretation to make the output more useful to the operator.
    The purpose of an NMS (very generally speaking) is to give an even higher layer of abstraction to organize the querying and reporting of all these various data into a useful system with dashboards, graphs, reports etc.

  • What is the best way to organize a tree-like structure of constants?

    Hello everone!
    Need help with organizing my constants structrure.
    I have several tables, and each of them need a list of column names to define the fields returned after query, and also a corresponding list of hashmap keys because that columnnames are ugly. Hashmap is where I store the result of searching through the table. This question is not about JDBC because I search through tables via COM interface, no JDBC ResultSets and other stuff here.
    Finally, for each table I have two constant lists and I have a list of tables. What is the best way to store this?
    My first idea was to create a enum and store column data in it as String array attributes: String[] columnNames; etc.
    But in this case I cannot use each column and key separately.
    Another option is to create two separate enums for each table: columnNames enum and keys enum. That doesn't look great also.
    The third option is to create inner class for each table and store two enums in each of that classes.
    Also I can store all data in hashmaps, Strings etc.
    (1) Finally, from your experience, what is the best way to organize all that stuff?
    (2) I have heard that smart Java programmer should avoid using the enums by any means. Do you agree?
    (3) Generally what will you prefer when creating a constant which has two values: two final Integers or enum?
    Edited by: Dmitry_MSK on Jul 8, 2010 5:22 AM

    I'm not sure why you don't just invent a generic data structure (e.g., table name, list of column names and aliases of column names) such as:
    class QueryMetaData {
      private final String tableName;
      private final String[] columnNames;
      private final String[] columnAliases;
    }Read into the above structure from a properties file, database table, etc. You can store meta-data itself in places other than enum constants, particularly if would like to change the meta-data without requiring a new build of your application.
    That having been said, WRT to your specific questions:
    (1) Finally, from your experience, what is the best way to organize all that stuff?See above
    (2) I have heard that smart Java programmer should avoid using the enums by any means. Do you agree?Enums are better than simple constants using int or String or something similar. If there are known, discrete values unlikely to change frequently, I see no issues with an enum. They improve the readability of code, and there are enough syntactic sugar features in the language (switch statements come to mind) to make them appealing.
    (3) Generally what will you prefer when creating a constant which has two values: two final Integers or enum?
    See above. Enums were introduced (in large part) to do away with storing constants as integers.
    - Saish

  • What is the best way to share a specific folder between macs????

    Hello, I would like to share a specific folder between macs, heres what I need to do:
    1) share one folder that resides in my home folder
    2) the other mac should be able to view it without any login information (no password etc)
    How? What is the best way?

    aapl.up wrote:
    Rick, are you saying that if you try to share a folder outside of home and use sharepoints, then the other mac wont prompt you to log in? Have you tried that? It is hard to believe that is the case
    I am sort of saying that. Have you tried it? I know it's hard to believe, but you really need to help us out by trying some steps that you don't believe.
    We can't see what your exact situation is. We sort of know what's worked for us out here. Just trying to help you get this going in less than 24 hours!
    Sharepoints manages the samba configuration file. It's free software that puts a pretty face on an otherwise cumbersome config file.
    Give it a shot.
    windows will not prompt for passwords, I have tried this with multiple computer at home for both vista and xp
    As I stated. You will not get prompted on windows, if you have set up sharing in an insecure fashion. You are not using a secured sharing situation.
    No argument with your statement.

  • What is the best way to run internet explorer on Mac and IPad and is it safe to do so??

    I need to run internet explorer to access new billing software,  what is the best way to do so and is it safe to run this on macbook and ipad if possible??

    You can't run IE on an iPad and the only way to use it on a Mac, since it's been discontinued for years for the Mac OS, is to install Windows either via Boot Camp or via running Windows as a virtual machine using something such as Parallels Desktop (my personal preference).
    Clinton

  • What is the best way to be able to run certain websites that aren't supported by safari, firefox, and chrome, in other words only internet explorer?

    I really need to do a class online but it wont save progress because it is not supported by safari and only works with internet explorer. What is the best way around this?

    Try this with Safari ...
    From the Safari menu bar click Safari > Preferences then select the Advanced tab.
    Select:   Show Develop menu in menu bar
    Now from the menu bar again click Develop > User Agent
    Try IE 9, 8, or 7.
    An alternative is to create a  partition on the Mac hard drive and install Windows using Boot Camp  but that is a long and drawn out process and you would need to purchase an Window install disc.
    Other ideas here >  The best way to run Windows on your Mac | Macworld

  • What is the best way to keep your macbook pro in tip top condition. performance wise

    What is the best way to keep the performance of a macbook pro in tip top shape.  Over the years my computer seems to act like a pc with all of its hicups and lockups.
    I am running mountain lion and this computer is approx 2 years old.
    Not sure if there is some sort of software that will help with this or is there something else I can do.
    Thanks
    GAJ

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; all should be made directly from the original data. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the App Store or Software Update preference pane (depending on the OS version), you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis.
    Keeping up to date is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible. Incompatibility with third-party software is by far the most common cause of trouble with system updates.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, such stuff is useless or worse than useless. Above all, avoid any software that purports to change the look and feel of the user interface.
    It's not much of an exaggeration to say that the whole "utility" software industry for the Mac is a fraud on consumers. The most extreme examples are the "CleanMyMac" and “MacKeeper” scams, but there are many others.
    As a rule, the only software you should install is that which directly enables you to do the things you use a computer for, and doesn't change the way other software works.
    Safari extensions, and perhaps the equivalent for other web browsers, are a partial exception to the above rule. Most are safe, and they're easy to get rid of if they don't work. Some may cause the browser to crash or otherwise malfunction.  Some are malicious. Use with caution, and install only well-known extensions from relatively trustworthy sources, such as the Safari Extensions Gallery.
    Never install any third-party software unless you know how to uninstall it. Otherwise you may create problems that are very hard to solve. Do not rely on "utilities" such as "AppCleaner" and the like that purport to remove software.
    4. Don't install bad, conflicting, or unnecessary fonts. Whenever you install new fonts, use the validation feature of the built-in Font Book application to make sure the fonts aren't defective and don't conflict with each other or with others that you already have. See the built-in help and this support article for instructions. Deactivate or remove fonts that you don't really need to speed up application launching.
    5. Avoid malware. Malware is malicious software that circulates on the Internet. This kind of attack on OS X was once so rare that it was hardly a concern, but malware is now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must come directly from the developer's website. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from the web, without your having requested it, should go straight into the Trash. A web page that tells you that your computer has a “virus,” or that anything else is wrong with it, is a scam.
    In OS X 10.7.5 or later, downloaded applications and Installer packages that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most people don't.
    6. Don't fill up your boot volume. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a boot failure. This is more prone to happen on the newer Macs that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem.
    While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage use and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    If storage space is running low, use a tool such as OmniDiskSweeper to explore the volume and find out what's taking up the most space. Move seldom-used large files to secondary storage.
    7. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” "defragmenting the drive," “running periodic scripts,” “dumping logs,” "deleting temp files," “scanning for viruses,” "purging memory," "checking for bad blocks," "testing the hardware," or “repairing permissions.” Such measures are either completely pointless or are useful only for solving problems, not for prevention.
    To use a Mac effectively, you have to free yourself from the Windows mindset that every computer needs regular downtime maintenance such as "defragging" and "registry cleaning." Those concepts do not apply to the Mac platform. A computing device is not something you should have to think about very much. It should be an almost transparent medium through which you communicate, work, and play. If you want a machine that is always whining for your attention like a neurotic dog, use a PC.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • What is the best way to re-install Windows XP in Boot Camp?

    I installed Windows XP on my Boot Camp partition on my MacBook for several months. Recently I have had serious problems with Windows Explorer (If I right click or try to copy, delete, drag files, it crashes). I've decided to just to do a clean install of XP and start over. What is the best way to do this?
    I realize that I can just remove the partition through Boot Camp assistant, but I have read people on the web have had some issues doing this. I've read that to Erase and reformat the Windows partition" is easier to do.
    There is also something called "Perform a Repair Installation" inside Windows XP. This would be preferable because I think this would allow all my applications to stay present. I don't have problems with my applications, just Explorer. Can I do this inside my Windows partition as if it were a normal Windows computer? This would be the best solution if it's possible.

    Axel,
    Unfortunately System Restore didn't work. I tried a few dates, but what happened is it said it couldn't restore and that my computer remained unchanged. So I will move on to the next stage. Reinstall Boot Camp drivers (I don't think that will help because they've worked flawlessly for so long) and then do a REPAIR WINDOWS.
    But I am going to wait until the weekend when I don't have work and can make sure I have a full backup, plus numerous other things, like doing uninstalls on some programs so that I can reinstall them should I end up with a totally complete new installation.
    My experience with Windows over the decades is that a lot of their utilities don't work as promised. That's what just happened with System Restore. So if I have a problem with REPAIR WINDOWS, do I just format my windows drive within Windows and reinstall, or what? Do I have to go back to OS X, eliminate the Windows partition, and start at the beginning with a new BootCamp and Windows installation? I'm asking, because once I get started I want to have a full road map.
    Also to clarify, this is with my MacBook. I have no problems with Windows on my Mac Pro.
    Thanks for your help.

  • What's the best way to create a login page in muse?

    Hi.
    Busy exploring muse I came across another problem:
    What’s the best way to create a login page in muse?
    I want to create 1 page on a site with access for people with login details only.
    Sorry for beeing a newbie
    Dutch greets
    Toin Corten

    Hi Toin,
    Never need to apologize for being a newbie...we all were at one point or another. 
    I am going to move this question to the main Muse forum where you'll have a much better chance of getting a response.  This particular forum is for questions around our Muse getting started project.
    You may also want to check this thread out: http://forums.adobe.com/thread/1004543.
    Thank you,
    Ed Sullivan

  • What is the best way to copy 700 local folders full of email to a new computer?

    I am moving my wife from and old computer (Thunderbird, Win XP) to a new one (Thunderbird Win 7). She has about 700 local folders with thousands of email messages in them. What is the best way to copy them to the new computer?

    The easiest way is just copy the whole profile.
    Help menu > troubleshooting information
    Close Thunderbird
    In windows explorer select all and copy.
    paste everything onto a thumb or other read/write portable media (not CD or DVD)
    on the new Machine repeat the troubleshooting and close steps to get the current profile folder
    This time paste everything from the portable media into the profile replacing what is there
    Open Thunderbird, your done mail contacts add-ons everything

  • What is the best way to use recovery files

    I am working in FM 11 and have crashed FM a few times. What is the best way to use the recovery files and save them as the normal file? Then should I filter an explorer window for "recovery" so FM won't keep asking me if I want to use older recovery files? Thanks for your help.

    > What is the best way to use the recovery files ...
    Use a .recover file to extract only the new/changed content that would otherwise be lost if you were instead to open the .auto (if any), or .backup files.
    > ... and save them as the normal file?
    Don't. If the document crashed because of an internal data structure problem, the .recover file (although actually a MIF) is apt to contain that problem.
    Before doing anything, preserve the debris. Copy the .backup and .auto files in particular, because as soon as you open the main .fm file, it's going to overwrite that .backup, and then the .auto at the next auto-save interval. You can dispose of any zero-length files or files with temporary names (which result from the crash itself crashing).
    I typically:
    preserve a snapshot of the debris
    open the original file, and if it won't, the .backup
    open the .recover, .auto or .backup (whichever seems the most useful candidate as a sourcing file)
    copy in the changes from the .recover, .auto or .backup to the working copy
    save the working copy as the original.fm, close the sourcing file
    do a MIF wash on the new original.fm
    clean up the debris in preparation for the next crash

  • What is the best way to close a communication session with the FP Server?

    Looking at NI's FieldPoint Demobox.vi example, the session is closed by wiring the FP Refnum out from the FP Create Tag vi for the AI module to the FP Close vi. Is there any difference if the FP Refnum out from any or all of the other FP Create Tags were wired to FP Close vi/vi's? Could the FP Refnum out from the FP Open vi be wired to the FP Close vi? What is the best way to do this?
    Also, as I'm new to FP and I'm conscious that I might swamp this forum with dumb questions, are the any sources of good FP code examples and/or discussions on coding techniques out there beyond the handful of NI's examples?
    Thanks again,
    Niel.

    Niel,
    The FP Open.vi provides a FP Refnum in the form of a data cluster. The cluster contains two elements; a server refnum and a tag refnum. Coming out of the FP Open, only the server refnum has a value, the tag refnum is created when the FP Create Tag.vi is processed. Thus all FP refnums in a process have the same server refnum but different tag refnums. The FP Close.vi uses the server refnum to close the server and ignores the tag refnum so it does not matter which particular refnum was used to close the server. The thing to be careful of is if you close on refnum, you close all refnums. At this point, any reads/writes/advises will result in error 32804 (Invalid IA handle specified).
    Also, please swamp this forum with questions. I am in the process of reviewin
    g the documentation and examples we provide and having a beginner asking questions that do not appear to be covered in our materials gives me an idea of what we are missing. I would ask that you upgrade to FieldPoint Explorer 2.0.4 and use the online help for LabVIEW since that has had some of my modifications added to it (program flow outlines, vi descriptions & use cases).
    Regards, Aaron

  • What is the best way to switch to Thunderbird from Incredimail (old emails and address book)?

    I'm feeling trapped in Incredimail. What is the best way to move over to Thunderbird? I'd like to keep my old emails, attachments and the address book as well. Is this possible?
    I've seen the program "PCVARE IncrediMail Converter" at www.pcvare.com/incredimail-converter.html#dl.
    Isn't there a better way (and free) to get out and away from the Incredimail trap?

    Bonjour,
    Open the address book window of TB. By the menu Tools / Import you can discover the possibilities and files formats accepted by TB for importing.
    I don't know Incredimail, explore the menus of Incredimail to find how you can export data.
    Pierre

  • What is the best way to be sure that there is no virus

    Hi guys,
    thanks for your responds,
    I believe my laptop has a virus or spyware. It is slow and take ages to comes up. Also during using internet exploring it is very slow in internet browsing.
    During use of msn chat voice sometime it freeze.
    What is the best way to be sure that there is no virus.
    I already have Norton 2007 with the latest update.
    thanks

    Hi
    > What is the best way to be sure that there is no virus?
    The best way is to use an Antivirus application and some Anti malware and Trojan applications.
    You use already the Norton Antivirus program. This is great. Be sure that this application is always up-to-date.
    Additional you could install Adaware. This is freeware tool and it scans your OS for malware.
    But the virus or malware is not always a reason for an OS freezing.
    Please check your processes which are running in the OS background. You can use additionally the application called CClean.
    It scans you OS for troubles and repair the registry.
    Maybe it helps

  • What is the best way to set up iTunes on our home network so all family members have access to all of our itunes library, even music we don't have on the cloud?

    I have five different people using 10 different apple devices on one itunes account in our family.  We have had trouble sharing.  What is the best way to set up itunes on our home network?  We have purchased music that sits on icloud, but we also have music we have imported from our previous cd library.  Our itunes program keeps crashing and dumping everyone's playlists.  So far we have all been using just the one desktop computer to sync to because we can't figure out how to share the same librarly and playlists on multiple computers in our home so devices can be synced at any location as well as playlists and purchases be made. 

    What is the best way to set up itunes on our home network? 
    One iTunes library per person.  One iTunes account per person.
    If people wish to share songs, they can make copies.
    When the inevitable day comes when the kids get older, you will not have to come back here and post asking how all that stuff can get separated!

Maybe you are looking for

  • Problem with BSP MVC

    Hi all, I had a bsp application which is now running live in the organization. Recently, I got a problem report back from user, which is causing data loss. After the support team check the problem and found out the source of the problem. Let me brief

  • It's Smart Sync selective posible?

    We need technical advising about Synchronization methods on Mobile Engine 2.1 or 2.5. (The plataform is still undefined). We have to develop a customer application which have to implement management of orders. Our customer would like us to implement

  • MBAM 2.5 - Remote SSRS instance

    Trying to install the MBAM Databases and Reports feature on the same SQL instance. The SQL box has other production database instances and I'm not able to install the MBAM bits on the server. I installed the MBAM bits on the server that will be hosti

  • Help in printing ALV grid

    Hi! I created an ALV grid. But the header and the footer part are not seen in the print preview, in which i think won't also be printed. What will I do for it to be printed? Thanks.

  • Question on LDAPSync Post Enable Provision Users to LDAP task

    Hi All, Can you please clarify my doubt on I created a user "testaccount" in OIM and via ldapsync, it gets created in OID. Now, I manaully deleted that user "testaccount" in OID and wants to recreate the user account again in OID. Will this schedule